mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
write failed responses to stderr
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 802d38f52e...a1823f9931
@@ -68,8 +68,8 @@ export class Program extends BaseProgram {
|
||||
});
|
||||
|
||||
program.on('command:*', () => {
|
||||
writeLn(chalk.redBright('Invalid command: ' + program.args.join(' ')));
|
||||
writeLn('See --help for a list of available commands.', true);
|
||||
writeLn(chalk.redBright('Invalid command: ' + program.args.join(' ')), false, true);
|
||||
writeLn('See --help for a list of available commands.', true, true);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
|
||||
@@ -8,11 +8,12 @@ import { FolderView } from 'jslib/models/view/folderView';
|
||||
import { NodeUtils } from 'jslib/misc/nodeUtils';
|
||||
|
||||
export class CliUtils {
|
||||
static writeLn(s: string, finalLine: boolean = false) {
|
||||
static writeLn(s: string, finalLine: boolean = false, error: boolean = false) {
|
||||
const stream = error ? process.stderr : process.stdout;
|
||||
if (finalLine && process.platform === 'win32') {
|
||||
process.stdout.write(s);
|
||||
stream.write(s);
|
||||
} else {
|
||||
process.stdout.write(s + '\n');
|
||||
stream.write(s + '\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user