feat: poll for /tmp/regex.txt and process contents

This commit is contained in:
Castor Regex 2025-08-25 10:21:30 -05:00 committed by Jeff Carr
parent 2747a978c7
commit 090986ca5a
1 changed files with 15 additions and 0 deletions

View File

@ -616,6 +616,21 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
[addMessage],
);
useEffect(() => {
const interval = setInterval(() => {
const filePath = '/tmp/regex.txt';
if (fs.existsSync(filePath)) {
const content = fs.readFileSync(filePath, 'utf-8');
if (content.trim().length > 0) {
handleFinalSubmit(content);
}
fs.unlinkSync(filePath);
}
}, 5000); // Check every 5 seconds
return () => clearInterval(interval);
}, [handleFinalSubmit]);
const handleIdePromptComplete = useCallback(
(result: IdeIntegrationNudgeResult) => {
if (result.userSelection === 'yes') {