mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
cli response objects
This commit is contained in:
@@ -2,15 +2,17 @@ import * as program from 'commander';
|
||||
|
||||
import { SyncService } from 'jslib/abstractions/sync.service';
|
||||
|
||||
import { Response } from '../models/response';
|
||||
|
||||
export class SyncCommand {
|
||||
constructor(private syncService: SyncService) { }
|
||||
|
||||
async run(cmd: program.Command) {
|
||||
async run(cmd: program.Command): Promise<Response> {
|
||||
try {
|
||||
const result = await this.syncService.fullSync(false);
|
||||
console.log(result);
|
||||
return Response.success();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return Response.success(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user