Fix the case where passthrough tools weren't using the correct CWD from -d
This commit is contained in:
parent
93458727e8
commit
8cfd915960
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { exec as _exec } from 'child_process';
|
import { exec as _exec, exec } from 'child_process';
|
||||||
import { useState, useRef, useCallback, useEffect } from 'react';
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
||||||
import { useInput } from 'ink';
|
import { useInput } from 'ink';
|
||||||
import {
|
import {
|
||||||
|
@ -115,8 +115,12 @@ export const useGeminiStream = (
|
||||||
return;
|
return;
|
||||||
} else if (config.getPassthroughCommands().includes(maybeCommand)) {
|
} else if (config.getPassthroughCommands().includes(maybeCommand)) {
|
||||||
// Execute and capture output
|
// Execute and capture output
|
||||||
setDebugMessage(`Executing shell command directly: ${query}`);
|
const targetDir = config.getTargetDir();
|
||||||
_exec(query, (error, stdout, stderr) => {
|
setDebugMessage(`Executing shell command in ${targetDir}: ${query}`);
|
||||||
|
const execOptions = {
|
||||||
|
cwd: targetDir,
|
||||||
|
};
|
||||||
|
_exec(query, execOptions, (error, stdout, stderr) => {
|
||||||
const timestamp = getNextMessageId(Date.now());
|
const timestamp = getNextMessageId(Date.now());
|
||||||
if (error) {
|
if (error) {
|
||||||
addHistoryItem(
|
addHistoryItem(
|
||||||
|
|
Loading…
Reference in New Issue