1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-15 07:43:27 +00:00

base cli program and sync command

This commit is contained in:
Kyle Spearrin
2019-03-16 11:27:16 -04:00
parent a847339d72
commit 7cc941cc84
5 changed files with 66 additions and 102 deletions

View File

@@ -1,12 +1,13 @@
import * as program from 'commander';
import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { Response } from 'jslib/cli/models/response';
import { MessageResponse } from 'jslib/cli/models/response/messageResponse';
export class ConfigCommand {
constructor(private environmentService: EnvironmentService) { }
constructor(private environmentService: EnvironmentService, private i18nService: I18nService) { }
async run(setting: string, value: string, cmd: program.Command): Promise<Response> {
setting = setting.toLowerCase();
@@ -18,7 +19,7 @@ export class ConfigCommand {
return Response.badRequest('Unknown setting.');
}
const res = new MessageResponse('Saved setting `' + setting + '`.', null);
const res = new MessageResponse(this.i18nService.t('savedSetting', setting), null);
return Response.success(res);
}