Skip to content

Commit

Permalink
Merge pull request #139 from gov4git/deploy-community
Browse files Browse the repository at this point in the history
dynamically set protocol CLI version
  • Loading branch information
dworthen committed Apr 8, 2024
2 parents 6c4a72e + cfee8ff commit c00ecfb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-insects-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gov4git-desktop-app': patch
---

Dynamically set protocol CLI version
3 changes: 3 additions & 0 deletions src/electron/configs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { resolve } from 'node:path'

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

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

export const GITHUB_OAUTH_CLIENT_ID = '912c0ab18e0f0b4a1abe'

export const CLI_VERSION = pkgJson['dependencies']['@gov4git/js-client']
2 changes: 2 additions & 0 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import type { InvokeServiceProps } from '~/shared'

import {
CLI_VERSION,
COMMUNITY_REPO_NAME,
CONFIG_PATH,
DB_PATH,
Expand Down Expand Up @@ -39,6 +40,7 @@ const logService = new LogService(resolve(CONFIG_PATH, 'logs.txt'))
services.register('log', logService)

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

async function setup(): Promise<void> {
try {
Expand Down
3 changes: 2 additions & 1 deletion src/electron/services/CommunityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { resolve } from 'path'

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

import { CLI_VERSION } from '../configs.js'
import { DB } from '../db/db.js'
import {
communities,
Expand Down Expand Up @@ -428,7 +429,7 @@ ${user.memberPublicBranch}`
'--project',
`${org}/${repo}`,
'--release',
'v2.2.5',
`v${CLI_VERSION}`,
]
await this.govService.mustRun(command, undefined, true)

Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true
}
}
}

0 comments on commit c00ecfb

Please sign in to comment.