mktmp ready file
This commit is contained in:
parent
090986ca5a
commit
4063298293
|
@ -63,7 +63,7 @@ import {
|
||||||
type IdeContext,
|
type IdeContext,
|
||||||
ideContext,
|
ideContext,
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
import { execFile } from 'child_process';
|
import { exec, execFile } from 'child_process';
|
||||||
import {
|
import {
|
||||||
IdeIntegrationNudge,
|
IdeIntegrationNudge,
|
||||||
IdeIntegrationNudgeResult,
|
IdeIntegrationNudgeResult,
|
||||||
|
@ -621,6 +621,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
const filePath = '/tmp/regex.txt';
|
const filePath = '/tmp/regex.txt';
|
||||||
if (fs.existsSync(filePath)) {
|
if (fs.existsSync(filePath)) {
|
||||||
const content = fs.readFileSync(filePath, 'utf-8');
|
const content = fs.readFileSync(filePath, 'utf-8');
|
||||||
|
fs.appendFileSync('/tmp/gemini-cli.log', content);
|
||||||
if (content.trim().length > 0) {
|
if (content.trim().length > 0) {
|
||||||
handleFinalSubmit(content);
|
handleFinalSubmit(content);
|
||||||
}
|
}
|
||||||
|
@ -631,6 +632,21 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [handleFinalSubmit]);
|
}, [handleFinalSubmit]);
|
||||||
|
|
||||||
|
const previousStreamingState = useRef(streamingState);
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
previousStreamingState.current !== StreamingState.Idle &&
|
||||||
|
streamingState === StreamingState.Idle
|
||||||
|
) {
|
||||||
|
exec('touch /tmp/regex.ready', (error) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(`exec error: ${error}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
previousStreamingState.current = streamingState;
|
||||||
|
}, [streamingState]);
|
||||||
|
|
||||||
const handleIdePromptComplete = useCallback(
|
const handleIdePromptComplete = useCallback(
|
||||||
(result: IdeIntegrationNudgeResult) => {
|
(result: IdeIntegrationNudgeResult) => {
|
||||||
if (result.userSelection === 'yes') {
|
if (result.userSelection === 'yes') {
|
||||||
|
|
Loading…
Reference in New Issue