merge: bring branch up to date with main
https://claude.ai/code/session_01Maa4rFLGVsFiLWynSbaVS8
This commit is contained in:
@@ -14,21 +14,27 @@ const TOOLS_PATH = path.join(__dirname, '..', 'get-shit-done', 'bin', 'gsd-tools
|
||||
* @param {string|string[]} args - Command string (shell-interpreted) or array
|
||||
* of arguments (shell-bypassed via execFileSync, safe for JSON and dollar signs).
|
||||
* @param {string} cwd - Working directory.
|
||||
* @param {object} [env] - Optional env overrides merged on top of process.env.
|
||||
* Pass { HOME: cwd } to sandbox ~/.gsd/ lookups in tests that assert concrete
|
||||
* config values that could be overridden by a developer's defaults.json.
|
||||
*/
|
||||
function runGsdTools(args, cwd = process.cwd()) {
|
||||
function runGsdTools(args, cwd = process.cwd(), env = {}) {
|
||||
try {
|
||||
let result;
|
||||
const childEnv = { ...process.env, ...env };
|
||||
if (Array.isArray(args)) {
|
||||
result = execFileSync(process.execPath, [TOOLS_PATH, ...args], {
|
||||
cwd,
|
||||
encoding: 'utf-8',
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
env: childEnv,
|
||||
});
|
||||
} else {
|
||||
result = execSync(`node "${TOOLS_PATH}" ${args}`, {
|
||||
cwd,
|
||||
encoding: 'utf-8',
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
env: childEnv,
|
||||
});
|
||||
}
|
||||
return { success: true, output: result.trim() };
|
||||
|
||||
Reference in New Issue
Block a user