Skip to content

Commit

Permalink
fix: fix version info
Browse files Browse the repository at this point in the history
  • Loading branch information
hmeltaus committed Mar 14, 2023
1 parent b51dbcd commit f2e0fcc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ jobs:

release:
runs-on: ubuntu-20.04
needs:
- unit-test
- integration-test
needs: build
# - unit-test
# - integration-test
steps:
- uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"scripts": {
"prepare": "husky install",
"build": "tsc",
"postbuild": "cp package.json dist/",
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --selectProjects test --maxWorkers=2 --ci --verbose",
"integration-test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --selectProjects integration-test --maxWorkers=5 --ci --verbose",
"clean": "rm -f package-lock.json && rm -rf node_modules && rm -rf dist",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initCommandContext = async (
}

const require = createRequire(import.meta.url)
const packageJson = require("../../package.json")
const packageJson = require("../package.json")
const buildInfo = {
version: packageJson.version,
}
Expand Down Expand Up @@ -142,7 +142,7 @@ export const onError = (e: any): void => {
}

const require = createRequire(import.meta.url)
const packageJson = require("../../package.json")
const packageJson = require("../package.json")

console.log()
console.log()
Expand Down
5 changes: 5 additions & 0 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createRequire } from "module"
import yargs from "yargs"
import { hideBin } from "yargs/helpers"
import { RunProps } from "./common.js"
Expand All @@ -6,6 +7,9 @@ import { iamCmd } from "./iam/index.js"
import { stacksCmd } from "./stacks/index.js"
export { initCommandContext } from "./common.js"

const require = createRequire(import.meta.url)
const packageJson = require("../package.json")

/**
* @hidden
*/
Expand Down Expand Up @@ -89,5 +93,6 @@ export const run = (props: RunProps = { showHelpOnFail: true }): void => {
.recommendCommands()
.strict(true)
.showHelpOnFail(props?.showHelpOnFail === true)
.version(packageJson.version)
.help().argv
}
2 changes: 1 addition & 1 deletion src/parser/project-config-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const validateRequiredVersion = async (
}

const require = createRequire(import.meta.url)
const packageJson = require("../../package.json")
const packageJson = require("../package.json")

if (!semver.satisfies(packageJson.version, requiredVersion)) {
throw new TakomoError(
Expand Down

0 comments on commit f2e0fcc

Please sign in to comment.