feat: automate DSH incident diagnosis repair evidence and Git issues
This commit is contained in:
1 parent
f437df2a83
commit
6c708224d2
21 files changed
+1232
-24
No files matched your search
@@ -3,6 +3,7 @@ import {createRequire} from 'node:module';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {mkdir, writeFile, readFile, cp} from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import {createInterface} from 'node:readline';
|
||||
|
||||
const root = path.dirname(fileURLToPath(import.meta.url));
|
||||
const require = createRequire(import.meta.url);
|
||||
@@ -98,7 +99,10 @@ export async function bootRuntime({announce=true} = {}) {
|
||||
const base = `http://127.0.0.1:${ctx.webServer.port}/`;
|
||||
if (announce) console.log('DX_DSH_READY '+JSON.stringify({url:ctx.connection.authenticatedUrl(base),version:VERSION}));
|
||||
if (process.env.DX_DSH_PARENT_PIPE === '1') {
|
||||
process.stdin.resume();
|
||||
createInterface({input:process.stdin}).on('line',line=>{
|
||||
if(line.length>100000)return;
|
||||
try{const command=JSON.parse(line);if(command.type==='diagnose')ctx.emit('dx/diagnose-request',command);}catch{}
|
||||
});
|
||||
process.stdin.on('end',()=>void shutdown.shutdown(0));
|
||||
}
|
||||
return {ctx,shutdown};
|
||||
|
||||
Reference in new issue
Block a user