Skip to content

Commit ed2d974

Browse files
authored
Fix version command (#18)
1 parent adaa615 commit ed2d974

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/deploy-published-releases.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ jobs:
3131
- name: Generate types
3232
run: npm run graphql-codegen
3333

34+
- name: Bump version
35+
run: |-
36+
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
37+
3438
- name: Build package
3539
run: npm run build
3640

3741
- name: Prepare release
3842
run: |-
3943
cp package.json LICENSE README.md build/
4044
cd build
41-
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
4245
4346
- name: Publish pre-release to NPM
4447
if: ${{ github.event.release.prerelease }}

.github/workflows/publish-pr-preview.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ jobs:
2929
- name: Generate types
3030
run: npm run graphql-codegen
3131

32+
- name: Bump version
33+
run: |-
34+
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
35+
3236
- name: Build package
3337
run: npm run build
3438

3539
- name: Prepare release
3640
run: |-
3741
cp package.json LICENSE README.md build/
3842
cd build
39-
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
4043
4144
- name: Publish preview
4245
run: |-

src/infrastructure/application/cli/program.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {Cli} from '@/infrastructure/application/cli/cli';
66
import {Resource} from '@/application/cli/command/init';
77
import {OptionMap} from '@/application/template/template';
88
import {ApiKeyPermission, ApplicationEnvironment} from '@/application/model/application';
9+
import packageJson from '@/../package.json';
910

1011
type Configuration = {
1112
interactive: boolean,
@@ -54,7 +55,7 @@ function createProgram(config: Configuration): typeof program {
5455
.implies({interaction: false}),
5556
)
5657
.option('--debug', 'Enable debug mode.')
57-
.version('0.0.1', '-v, --version', 'Display the version number.')
58+
.version(packageJson.version, '-v, --version', 'Display the version number.')
5859
.helpOption('-h, --help', 'Display help for a command.')
5960
.helpCommand('help [command]', 'Display help for a command.');
6061

0 commit comments

Comments
 (0)