Skip to content

Commit

Permalink
feat[cli]: --version flag (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-trunov authored Feb 16, 2024
1 parent de1dde2 commit 925a158
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ jobs:
- run: yarn build
- run: yarn gen
- run: yarn coverage
- name: Compare Tact version from CLI flag `--version` against package.json
if: runner.os != 'Windows'
run: |
if [ "$(./bin/tact --version)" != "$(jq -r '.version' < package.json)" ];
then false
fi
9 changes: 8 additions & 1 deletion bin/tact
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ const arg = require('arg');
// Resolve arguments
const args = arg({
'--config': String,
'--project': String
'--project': String,
'--version': Boolean
});

if (args['--version']) {
console.log('1.1.5');
return;
}

if (!args['--config']) {
console.log('USAGE: tact --config <config_path> [--project <project_name]');
return;
Expand Down

0 comments on commit 925a158

Please sign in to comment.