@handsupmin/gc-tree 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli.js +4 -1
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
4
5
|
import { stdin, stderr, stdout } from 'node:process';
|
|
5
6
|
import { readAsciiLogo, readAsciiTree } from './ascii.js';
|
|
7
|
+
import { gctreeGlobalRoot } from './integration-files.js';
|
|
6
8
|
import { dispatchGcTreeHook } from './hook.js';
|
|
7
9
|
import { onboardBranch } from './onboard.js';
|
|
8
10
|
import { buildProviderLaunchPlan, maybeLaunchProvider, promptLanguageSelection, promptLaunchProviderSelection, promptProviderSelection, } from './provider.js';
|
|
@@ -525,9 +527,10 @@ async function main() {
|
|
|
525
527
|
if (!host)
|
|
526
528
|
usage();
|
|
527
529
|
const explicitTarget = readArg('--target');
|
|
530
|
+
const isGlobal = !explicitTarget || Object.values({ codex: gctreeGlobalRoot('codex'), claude: gctreeGlobalRoot('claude-code') }).some((r) => resolve(explicitTarget) === resolve(r));
|
|
528
531
|
const result = await ensureScaffold({
|
|
529
532
|
providerMode: host,
|
|
530
|
-
...(
|
|
533
|
+
...(isGlobal ? { scope: 'global' } : { targetDir: explicitTarget, scope: 'local' }),
|
|
531
534
|
force: hasFlag('--force'),
|
|
532
535
|
});
|
|
533
536
|
console.log(JSON.stringify(result, null, 2));
|