Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
term(`\nGenerating ECDSA keypair...`)
const key: Key = ks.genKeyPair(conf.callsign)
await timeout(2000) // delay for dramatic effect, lol
term(`\nPublic Key: ^c${key.public}^\n`)
// signatures are created using a private key, but we don't want to include
// the private key in the config file, so instead we use the public key
// as the identifier, and then actually sign with the private key.
conf.signingKey = key.public
try {
save(conf)
term(`\nSettings saved to ${defaultConfigPath}\n`)
} catch (err) {
term(`\nError saving settings to ${defaultConfigPath}\n`)
term.processExit()
}
}
})().catch(error => {
console.error(error);
terminal.processExit(1);
});
terminal.on('key', function(key, matches, data){
switch ( key ){
case 'CTRL_C':
if( hook )
hook.disconnect();
console.log();
terminal.processExit(0);
break;
}
});
},
export function exit(code: number = 0) {
terminal.grabInput(false);
terminal.hideCursor(false);
terminal.fullscreen(false);
flushConsole(terminal);
terminal.processExit(code);
}
case 'BACKSPACE':
const parentPath = path.dirname( current.path );
if ( isProjectPath( parentPath ) ) {
current = Folder( parentPath );
render();
} else {
term.bell();
}
break;
case 'ESCAPE':
term.clear();
term.processExit();
break;
}
} );
complete(exitCode: number = 0) {
this.logger.dispose();
if (this.inspectorClient) {
this.inspectorClient.emitEvent(new RuntimeCompleteEvent(exitCode));
this.inspectorClient.close();
}
terminal.processExit(exitCode);
}
}
term.red( error.toString() + '\n' ) ;
process.exit( 1 ) ;
}
term( '\n' ) ;
if ( ! streams.output ) {
httpRequester.displayBody( body , incomingMessage ) ;
httpRequester.displayTrailer( incomingMessage ) ;
}
term.dim.magenta( '[Received ' +
( body ? utils.byteString( body.length ) + ' ' : '' ) +
'in ' + httpRequester.lastResponse.time + 'ms]\n' ) ;
term.processExit( 0 ) ;
} ;
export function exit(code: number): void {
term.processExit(code)
}