Skip to content

Commit

Permalink
Merge pull request desktop#19733 from desktop/cli-direct-invoke
Browse files Browse the repository at this point in the history
Have CLI invoke the app directly
  • Loading branch information
niik authored Dec 19, 2024
2 parents 987e811 + 108dbfb commit 31b4d58
Show file tree
Hide file tree
Showing 23 changed files with 176 additions and 551 deletions.
16 changes: 0 additions & 16 deletions app/app-info.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import * as fs from 'fs'
import * as Path from 'path'

import { getSHA } from './git-info'
import { getUpdatesURL, getChannel } from '../script/dist-info'
import { version, productName } from './package.json'

const projectRoot = Path.dirname(__dirname)

const devClientId = '3a723b10ac5575cc5bb9'
const devClientSecret = '22c34d87789a365981ed921352a7b9a8c3f69d54'

const channel = getChannel()

export function getCLICommands() {
return (
// eslint-disable-next-line no-sync
fs
.readdirSync(Path.resolve(projectRoot, 'app', 'src', 'cli', 'commands'))
.filter(name => name.endsWith('.ts'))
.map(name => name.replace(/\.ts$/, ''))
)
}

const s = JSON.stringify

export function getReplacements() {
Expand All @@ -41,7 +26,6 @@ export function getReplacements() {
__RELEASE_CHANNEL__: s(channel),
__UPDATES_URL__: s(getUpdatesURL()),
__SHA__: s(getSHA()),
__CLI_COMMANDS__: s(getCLICommands()),
'process.platform': s(process.platform),
'process.env.NODE_ENV': s(process.env.NODE_ENV || 'development'),
'process.env.TEST_ENV': s(process.env.TEST_ENV),
Expand Down
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"marked": "^4.0.10",
"mem": "^4.3.0",
"memoize-one": "^4.0.3",
"minimist": "^1.2.8",
"mri": "^1.1.0",
"p-limit": "^2.2.0",
"p-memoize": "^7.1.1",
Expand Down
46 changes: 0 additions & 46 deletions app/src/cli/commands/clone.ts

This file was deleted.

79 changes: 0 additions & 79 deletions app/src/cli/commands/help.ts

This file was deleted.

39 changes: 0 additions & 39 deletions app/src/cli/commands/open.ts

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/cli/dev-commands-global.ts

This file was deleted.

50 changes: 0 additions & 50 deletions app/src/cli/load-commands.ts

This file was deleted.

Loading

0 comments on commit 31b4d58

Please sign in to comment.