Skip to content

Commit

Permalink
Fix issue with importing package.json (#1030)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Dec 11, 2020
1 parent acc84a5 commit 91a6204
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import * as https from 'https'
import * as yaml from 'js-yaml'
import * as notifier from 'node-notifier'

const pkjson = require('../package.json')

import { ChectlContext } from './api/context'
import { DEFAULT_CHE_OPERATOR_IMAGE } from './constants'

Expand Down Expand Up @@ -181,16 +183,14 @@ export function getCommandErrorMessage(err: Error): string {
* Returns current chectl version defined in package.json.
*/
export function getCurrentChectlVersion(): string {
const { version } = readPackageJson()
return version
return pkjson.version
}

/**
* Returns current chectl version defined in package.json.
*/
export function getCurrentChectlName(): string {
const { name } = readPackageJson()
return name
return pkjson.name
}

export function readPackageJson(): any {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"module": "commonjs",
"moduleResolution": "node",
"target": "es6",
"sourceMap": true,
"resolveJsonModule": true
"sourceMap": true
},
"include": [
"src"
Expand Down

0 comments on commit 91a6204

Please sign in to comment.