code-squad-cli 2.1.2 → 2.1.3
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/index.js +17 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2043,22 +2043,23 @@ csq() {
|
|
|
2043
2043
|
fi
|
|
2044
2044
|
|
|
2045
2045
|
local output
|
|
2046
|
-
output=$(command csq "$@"
|
|
2046
|
+
output=$(command csq "$@")
|
|
2047
2047
|
local exit_code=$?
|
|
2048
2048
|
|
|
2049
2049
|
if [[ $exit_code -ne 0 ]]; then
|
|
2050
|
-
echo "$output"
|
|
2051
2050
|
return $exit_code
|
|
2052
2051
|
fi
|
|
2053
2052
|
|
|
2054
|
-
# \uB9C8\uC9C0\uB9C9 \uC904\uC774 \uB514\uB809\uD1A0\uB9AC\uBA74 cd
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2053
|
+
# stdout\uC758 \uB9C8\uC9C0\uB9C9 \uC904\uC774 \uB514\uB809\uD1A0\uB9AC\uBA74 cd
|
|
2054
|
+
if [[ -n "$output" ]]; then
|
|
2055
|
+
local last_line=$(echo "$output" | tail -1)
|
|
2056
|
+
if [[ -d "$last_line" ]]; then
|
|
2057
|
+
local rest=$(echo "$output" | sed '$d')
|
|
2058
|
+
[[ -n "$rest" ]] && echo "$rest"
|
|
2059
|
+
cd "$last_line"
|
|
2060
|
+
else
|
|
2061
|
+
echo "$output"
|
|
2062
|
+
fi
|
|
2062
2063
|
fi
|
|
2063
2064
|
}
|
|
2064
2065
|
`.trim();
|
|
@@ -2086,9 +2087,9 @@ async function createWorktreeCommand(workspaceRoot, args) {
|
|
|
2086
2087
|
const worktreePath = path12.join(defaultBasePath, name);
|
|
2087
2088
|
try {
|
|
2088
2089
|
await gitAdapter.createWorktree(worktreePath, name, workspaceRoot);
|
|
2089
|
-
console.
|
|
2090
|
+
console.error(chalk.green(`\u2713 Created worktree: ${name}`));
|
|
2090
2091
|
await copyWorktreeFiles(workspaceRoot, worktreePath);
|
|
2091
|
-
|
|
2092
|
+
process.stdout.write(worktreePath + "\n");
|
|
2092
2093
|
} catch (error) {
|
|
2093
2094
|
console.error(chalk.red(`Failed to create worktree: ${error.message}`));
|
|
2094
2095
|
process.exit(1);
|
|
@@ -2119,8 +2120,8 @@ async function quitWorktreeCommand() {
|
|
|
2119
2120
|
try {
|
|
2120
2121
|
await gitAdapter.removeWorktree(context.currentPath, context.mainRoot, true);
|
|
2121
2122
|
await gitAdapter.deleteBranch(context.branch, context.mainRoot, true);
|
|
2122
|
-
console.
|
|
2123
|
-
|
|
2123
|
+
console.error(chalk.green(`\u2713 Deleted worktree and branch: ${context.branch}`));
|
|
2124
|
+
process.stdout.write(context.mainRoot + "\n");
|
|
2124
2125
|
} catch (error) {
|
|
2125
2126
|
console.error(chalk.red(`Failed to quit: ${error.message}`));
|
|
2126
2127
|
process.exit(1);
|
|
@@ -2134,10 +2135,10 @@ async function copyWorktreeFiles(sourceRoot, destRoot) {
|
|
|
2134
2135
|
}
|
|
2135
2136
|
const { copied, failed } = await copyFilesWithPatterns(sourceRoot, destRoot, patterns);
|
|
2136
2137
|
if (copied.length > 0) {
|
|
2137
|
-
console.
|
|
2138
|
+
console.error(chalk.green(`\u2713 Copied ${copied.length} file(s) to worktree`));
|
|
2138
2139
|
}
|
|
2139
2140
|
if (failed.length > 0) {
|
|
2140
|
-
console.
|
|
2141
|
+
console.error(chalk.yellow(`\u26A0 Failed to copy ${failed.length} file(s)`));
|
|
2141
2142
|
}
|
|
2142
2143
|
}
|
|
2143
2144
|
main().catch((error) => {
|