(args: string[])
| 29 | }); |
| 30 | |
| 31 | function run(args: string[]): { stdout: string; stderr: string; exitCode: number } { |
| 32 | try { |
| 33 | const stdout = execSync([SETTINGS_HOOK, ...args].map((s) => `'${s}'`).join(' '), { |
| 34 | env: { ...process.env, GSTACK_SETTINGS_FILE: settingsFile }, |
| 35 | encoding: 'utf-8', |
| 36 | timeout: 10000, |
| 37 | }); |
| 38 | return { stdout, stderr: '', exitCode: 0 }; |
| 39 | } catch (e: any) { |
| 40 | return { stdout: e.stdout || '', stderr: e.stderr || '', exitCode: e.status ?? 1 }; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | function settings(): any { |
| 45 | return JSON.parse(fs.readFileSync(settingsFile, 'utf-8')); |
no outgoing calls
no test coverage detected