mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
19 lines
514 B
TypeScript
19 lines
514 B
TypeScript
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): Promise<Response> {
|
|
try {
|
|
const result = await this.syncService.fullSync(cmd.force || false);
|
|
return Response.success();
|
|
} catch (e) {
|
|
return Response.success(e.toString());
|
|
}
|
|
}
|
|
}
|