File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77// listeners are attached. With the fix the watcher still starts; without the
88// stream error listeners the unhandled errors would terminate the process.
99
10- import { createRequire } from "node:module" ;
1110import fs from "node:fs/promises" ;
11+ import { createRequire } from "node:module" ;
1212import os from "node:os" ;
1313import path from "node:path" ;
1414import { fileURLToPath } from "node:url" ;
1515
1616const repoRoot = path . dirname ( path . dirname ( path . dirname ( fileURLToPath ( import . meta. url ) ) ) ) ;
1717
1818const require = createRequire ( import . meta. url ) ;
19- const childProcess = require ( "node:child_process" ) ;
19+ const childProcess = require ( "node:child_process" ) as typeof import ( "node:child_process" ) ;
2020const originalSpawn = childProcess . spawn ;
2121
2222const tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , "openclaw-proof-gog-" ) ) ;
@@ -48,7 +48,7 @@ process.env.PATH = `${tmpDir}${path.delimiter}${process.env.PATH ?? ""}`;
4848// emit error events after startGmailWatcher attaches listeners.
4949childProcess . spawn = ( ...args : Parameters < typeof originalSpawn > ) => {
5050 const child = originalSpawn . apply ( childProcess , args ) ;
51- const cmd = String ( args [ 0 ] ?? "" ) ;
51+ const cmd = args [ 0 ] ?? "" ;
5252 const argv = args [ 1 ] as string [ ] | undefined ;
5353 if ( cmd === "gog" || argv ?. [ 0 ] === "gmail" ) {
5454 setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments