From e41514db2f583b6e7852d15db40be347d7dcd6f5 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 12 Apr 2021 10:13:00 -0500 Subject: [PATCH] Update jslib (#286) * Update jslib * Fix jslib update items --- jslib | 2 +- src/bw.ts | 10 +++++----- src/program.ts | 4 ++-- src/send.program.ts | 2 +- src/vault.program.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/jslib b/jslib index 08a856645b..62cc43fb46 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 08a856645b14c11c62c730e34075addc34520f13 +Subproject commit 62cc43fb46aecef078f3f5278502593b6abaf127 diff --git a/src/bw.ts b/src/bw.ts index 4005a8ae12..c03db46b14 100644 --- a/src/bw.ts +++ b/src/bw.ts @@ -131,7 +131,7 @@ export class Main { this.storageService, this.i18nService, this.cipherService); this.collectionService = new CollectionService(this.cryptoService, this.userService, this.storageService, 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.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService, this.storageService, this.i18nService, this.cryptoFunctionService); @@ -160,9 +160,9 @@ export class Main { async run() { await this.init(); - this.program.register(); - this.vaultProgram.register(); - this.sendProgram.register(); + await this.program.register(); + await this.vaultProgram.register(); + await this.sendProgram.register(); program .parse(process.argv); @@ -205,7 +205,7 @@ export class Main { this.authService.init(); const installedVersion = await this.storageService.get(ConstantsService.installedVersionKey); - const currentVersion = this.platformUtilsService.getApplicationVersion(); + const currentVersion = await this.platformUtilsService.getApplicationVersion(); if (installedVersion == null || installedVersion !== currentVersion) { await this.storageService.save(ConstantsService.installedVersionKey, currentVersion); } diff --git a/src/program.ts b/src/program.ts index 26481c2c82..cb66aa629b 100644 --- a/src/program.ts +++ b/src/program.ts @@ -33,7 +33,7 @@ export class Program extends BaseProgram { super(main.userService, writeLn); } - register() { + async register() { program .option('--pretty', 'Format output. JSON is tabbed with two spaces.') .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('--nointeraction', 'Do not prompt for interactive user input.') .option('--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', () => { process.env.BW_PRETTY = 'true'; diff --git a/src/send.program.ts b/src/send.program.ts index 8aad04dd1b..d482b6ccbd 100644 --- a/src/send.program.ts +++ b/src/send.program.ts @@ -34,7 +34,7 @@ export class SendProgram extends Program { super(main); } - register() { + async register() { program.addCommand(this.sendCommand()); // receive is accessible both at `bw receive` and `bw send receive` program.addCommand(this.receiveCommand()); diff --git a/src/vault.program.ts b/src/vault.program.ts index 6679e0d399..87262b5b76 100644 --- a/src/vault.program.ts +++ b/src/vault.program.ts @@ -26,7 +26,7 @@ export class VaultProgram extends Program { super(main); } - register() { + async register() { program .command('list ') .description('List an array of objects from the vault.')