ticketpro-auto-setup 1.1.2 → 1.1.4
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.
|
@@ -44,7 +44,7 @@ async function runCodeAbyss(target, spinner) {
|
|
|
44
44
|
const { npxCmd, npmCmd } = getPlatform();
|
|
45
45
|
// 方式 1: npx -y code-abyss --target <target>
|
|
46
46
|
spinner.text = `Installing code-abyss → ${target} (npx)...`;
|
|
47
|
-
const result = await spawnCodeAbyss(npxCmd, ['-y', 'code-abyss', '--target', target]);
|
|
47
|
+
const result = await spawnCodeAbyss(npxCmd, ['-y', 'code-abyss', '--target', target, '-y']);
|
|
48
48
|
if (result.success) {
|
|
49
49
|
spinner.succeed(`code-abyss installed → ${target}`);
|
|
50
50
|
return { name, success: true };
|
|
@@ -56,7 +56,7 @@ async function runCodeAbyss(target, spinner) {
|
|
|
56
56
|
});
|
|
57
57
|
if (installResult.success) {
|
|
58
58
|
spinner.text = `Running code-abyss → ${target} (global)...`;
|
|
59
|
-
const execResult = await spawnCodeAbyss('code-abyss', ['--target', target]);
|
|
59
|
+
const execResult = await spawnCodeAbyss('code-abyss', ['--target', target, '-y']);
|
|
60
60
|
if (execResult.success) {
|
|
61
61
|
spinner.succeed(`code-abyss installed → ${target} (global)`);
|
|
62
62
|
return { name, success: true };
|
|
@@ -25,7 +25,7 @@ export async function installHelloAgents() {
|
|
|
25
25
|
}
|
|
26
26
|
// git clone
|
|
27
27
|
spinner.text = 'Cloning helloagents repository...';
|
|
28
|
-
const cloneResult = await execAsync(`${gitCmd} clone https://github.com/hellowind777/helloagents.git "${tmpDir}"`, { timeout: 120_000 });
|
|
28
|
+
const cloneResult = await execAsync(`${gitCmd} clone https://github.com/hellowind777/helloagents.git "${tmpDir}"`, { cwd: getPlatform().homeDir, timeout: 120_000 });
|
|
29
29
|
if (!cloneResult.success) {
|
|
30
30
|
spinner.fail('helloagents: git clone failed');
|
|
31
31
|
log.dim('请手动执行: git clone https://github.com/hellowind777/helloagents.git');
|
|
@@ -28,7 +28,7 @@ export async function installJshookSkill() {
|
|
|
28
28
|
}
|
|
29
29
|
// git clone
|
|
30
30
|
spinner.text = 'Cloning jshook-skill repository...';
|
|
31
|
-
const cloneResult = await execAsync(`${gitCmd} clone ${JSHOOK_REPO} "${skillDir}"`, { timeout: 120_000 });
|
|
31
|
+
const cloneResult = await execAsync(`${gitCmd} clone ${JSHOOK_REPO} "${skillDir}"`, { cwd: getPlatform().homeDir, timeout: 120_000 });
|
|
32
32
|
if (!cloneResult.success) {
|
|
33
33
|
spinner.fail('jshook-skill: git clone failed');
|
|
34
34
|
log.dim(`请手动执行: git clone ${JSHOOK_REPO} ~/.claude/skills/jshook-skill`);
|
package/dist/pages/cleanup.js
CHANGED
|
@@ -57,17 +57,9 @@ export async function performCleanup() {
|
|
|
57
57
|
removeDirectory(codexDir);
|
|
58
58
|
log.dim('~/.codex removed');
|
|
59
59
|
}
|
|
60
|
-
// 4.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (fs.existsSync(projectClaude)) {
|
|
64
|
-
removeDirectory(projectClaude);
|
|
65
|
-
log.dim('Project .claude/ removed');
|
|
66
|
-
}
|
|
67
|
-
if (fs.existsSync(projectCodex)) {
|
|
68
|
-
removeDirectory(projectCodex);
|
|
69
|
-
log.dim('Project .codex/ removed');
|
|
70
|
-
}
|
|
60
|
+
// 4. 不再删除“当前目录下的 .claude/.codex”
|
|
61
|
+
// 说明:npx 场景下用户 cwd 可能是任意目录,删除相对路径有误删风险,
|
|
62
|
+
// 甚至可能删掉当前工作目录导致后续 npm/git 出现 uv_cwd / getcwd 错误。
|
|
71
63
|
cleanSpinner.succeed('Environment cleaned');
|
|
72
64
|
console.log();
|
|
73
65
|
}
|
package/dist/utils/shell.js
CHANGED
|
@@ -10,9 +10,10 @@ export function execCommand(command, options) {
|
|
|
10
10
|
const { isWindows } = getPlatform();
|
|
11
11
|
const shellCmd = isWindows ? 'cmd.exe' : '/bin/bash';
|
|
12
12
|
const shellArg = isWindows ? '/c' : '-c';
|
|
13
|
+
const safeCwd = options?.cwd ?? getPlatform().homeDir;
|
|
13
14
|
try {
|
|
14
15
|
const stdout = execSync(command, {
|
|
15
|
-
cwd:
|
|
16
|
+
cwd: safeCwd,
|
|
16
17
|
timeout: options?.timeout ?? 120_000,
|
|
17
18
|
encoding: 'utf-8',
|
|
18
19
|
shell: isWindows ? 'cmd.exe' : '/bin/bash',
|
|
@@ -48,8 +49,9 @@ export function execAsync(command, options) {
|
|
|
48
49
|
const shell = isWindows ? 'cmd.exe' : '/bin/bash';
|
|
49
50
|
const shellArg = isWindows ? '/c' : '-c';
|
|
50
51
|
const timeout = options?.timeout ?? 300_000;
|
|
52
|
+
const safeCwd = options?.cwd ?? getPlatform().homeDir;
|
|
51
53
|
const child = spawn(shell, [shellArg, command], {
|
|
52
|
-
cwd:
|
|
54
|
+
cwd: safeCwd,
|
|
53
55
|
env: { ...process.env, ...options?.env },
|
|
54
56
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
55
57
|
});
|