mirror of
https://github.com/bitwarden/cli
synced 2025-12-14 15:23:36 +00:00
2
jslib
2
jslib
Submodule jslib updated: 08a856645b...62cc43fb46
10
src/bw.ts
10
src/bw.ts
@@ -131,7 +131,7 @@ export class Main {
|
|||||||
this.storageService, this.i18nService, this.cipherService);
|
this.storageService, this.i18nService, this.cipherService);
|
||||||
this.collectionService = new CollectionService(this.cryptoService, this.userService, this.storageService,
|
this.collectionService = new CollectionService(this.cryptoService, this.userService, this.storageService,
|
||||||
this.i18nService);
|
this.i18nService);
|
||||||
this.searchService = new SearchService(this.cipherService, this.logService);
|
this.searchService = new SearchService(this.cipherService, this.logService, this.i18nService);
|
||||||
this.policyService = new PolicyService(this.userService, this.storageService);
|
this.policyService = new PolicyService(this.userService, this.storageService);
|
||||||
this.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService,
|
this.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService,
|
||||||
this.storageService, this.i18nService, this.cryptoFunctionService);
|
this.storageService, this.i18nService, this.cryptoFunctionService);
|
||||||
@@ -160,9 +160,9 @@ export class Main {
|
|||||||
async run() {
|
async run() {
|
||||||
await this.init();
|
await this.init();
|
||||||
|
|
||||||
this.program.register();
|
await this.program.register();
|
||||||
this.vaultProgram.register();
|
await this.vaultProgram.register();
|
||||||
this.sendProgram.register();
|
await this.sendProgram.register();
|
||||||
|
|
||||||
program
|
program
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
@@ -205,7 +205,7 @@ export class Main {
|
|||||||
this.authService.init();
|
this.authService.init();
|
||||||
|
|
||||||
const installedVersion = await this.storageService.get<string>(ConstantsService.installedVersionKey);
|
const installedVersion = await this.storageService.get<string>(ConstantsService.installedVersionKey);
|
||||||
const currentVersion = this.platformUtilsService.getApplicationVersion();
|
const currentVersion = await this.platformUtilsService.getApplicationVersion();
|
||||||
if (installedVersion == null || installedVersion !== currentVersion) {
|
if (installedVersion == null || installedVersion !== currentVersion) {
|
||||||
await this.storageService.save(ConstantsService.installedVersionKey, currentVersion);
|
await this.storageService.save(ConstantsService.installedVersionKey, currentVersion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export class Program extends BaseProgram {
|
|||||||
super(main.userService, writeLn);
|
super(main.userService, writeLn);
|
||||||
}
|
}
|
||||||
|
|
||||||
register() {
|
async register() {
|
||||||
program
|
program
|
||||||
.option('--pretty', 'Format output. JSON is tabbed with two spaces.')
|
.option('--pretty', 'Format output. JSON is tabbed with two spaces.')
|
||||||
.option('--raw', 'Return raw output instead of a descriptive message.')
|
.option('--raw', 'Return raw output instead of a descriptive message.')
|
||||||
@@ -41,7 +41,7 @@ export class Program extends BaseProgram {
|
|||||||
.option('--quiet', 'Don\'t return anything to stdout.')
|
.option('--quiet', 'Don\'t return anything to stdout.')
|
||||||
.option('--nointeraction', 'Do not prompt for interactive user input.')
|
.option('--nointeraction', 'Do not prompt for interactive user input.')
|
||||||
.option('--session <session>', 'Pass session key instead of reading from env.')
|
.option('--session <session>', 'Pass session key instead of reading from env.')
|
||||||
.version(this.main.platformUtilsService.getApplicationVersion(), '-v, --version');
|
.version(await this.main.platformUtilsService.getApplicationVersion(), '-v, --version');
|
||||||
|
|
||||||
program.on('option:pretty', () => {
|
program.on('option:pretty', () => {
|
||||||
process.env.BW_PRETTY = 'true';
|
process.env.BW_PRETTY = 'true';
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class SendProgram extends Program {
|
|||||||
super(main);
|
super(main);
|
||||||
}
|
}
|
||||||
|
|
||||||
register() {
|
async register() {
|
||||||
program.addCommand(this.sendCommand());
|
program.addCommand(this.sendCommand());
|
||||||
// receive is accessible both at `bw receive` and `bw send receive`
|
// receive is accessible both at `bw receive` and `bw send receive`
|
||||||
program.addCommand(this.receiveCommand());
|
program.addCommand(this.receiveCommand());
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class VaultProgram extends Program {
|
|||||||
super(main);
|
super(main);
|
||||||
}
|
}
|
||||||
|
|
||||||
register() {
|
async register() {
|
||||||
program
|
program
|
||||||
.command('list <object>')
|
.command('list <object>')
|
||||||
.description('List an array of objects from the vault.')
|
.description('List an array of objects from the vault.')
|
||||||
|
|||||||
Reference in New Issue
Block a user