Skip to content

Commit c00ecfb

Browse files
authored
Merge pull request #139 from gov4git/deploy-community
dynamically set protocol CLI version
2 parents 6c4a72e + cfee8ff commit c00ecfb

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

.changeset/gold-insects-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gov4git-desktop-app': patch
3+
---
4+
5+
Dynamically set protocol CLI version

src/electron/configs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { resolve } from 'node:path'
22

3+
import * as pkgJson from '../../package.json'
34
import { toResolvedPath } from './lib/paths.js'
45

56
export const CONFIG_PATH = toResolvedPath(
@@ -13,3 +14,5 @@ export const COMMUNITY_REPO_NAME =
1314
process.env['GOV4GIT_COMMUNITY_REPO_NAME'] ?? 'gov4git-identity'
1415

1516
export const GITHUB_OAUTH_CLIENT_ID = '912c0ab18e0f0b4a1abe'
17+
18+
export const CLI_VERSION = pkgJson['dependencies']['@gov4git/js-client']

src/electron/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import type { InvokeServiceProps } from '~/shared'
1212

1313
import {
14+
CLI_VERSION,
1415
COMMUNITY_REPO_NAME,
1516
CONFIG_PATH,
1617
DB_PATH,
@@ -39,6 +40,7 @@ const logService = new LogService(resolve(CONFIG_PATH, 'logs.txt'))
3940
services.register('log', logService)
4041

4142
logService.info(`Gov4Git Version ${logService.getAppVersion()}`)
43+
logService.info(`CLI_VERSION of protocol: ${CLI_VERSION}`)
4244

4345
async function setup(): Promise<void> {
4446
try {

src/electron/services/CommunityService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { resolve } from 'path'
33

44
import { AbstractCommunityService, Expand, ServiceResponse } from '~/shared'
55

6+
import { CLI_VERSION } from '../configs.js'
67
import { DB } from '../db/db.js'
78
import {
89
communities,
@@ -428,7 +429,7 @@ ${user.memberPublicBranch}`
428429
'--project',
429430
`${org}/${repo}`,
430431
'--release',
431-
'v2.2.5',
432+
`v${CLI_VERSION}`,
432433
]
433434
await this.govService.mustRun(command, undefined, true)
434435

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"noPropertyAccessFromIndexSignature": true,
3333
"noUncheckedIndexedAccess": true,
3434
"noImplicitReturns": true,
35-
"noFallthroughCasesInSwitch": true
35+
"noFallthroughCasesInSwitch": true,
36+
"resolveJsonModule": true
3637
}
37-
}
38+
}

0 commit comments

Comments
 (0)