mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-14 19:35:12 -05:00
fix: code housekeeping
This commit is contained in:
parent
f3ed8fbcf7
commit
262bdcd2dc
3 changed files with 12 additions and 6 deletions
|
@ -54,7 +54,7 @@ export class SparoCommandLine {
|
|||
// proxy to gitService
|
||||
if (!this._supportedCommand(userInputCmdName)) {
|
||||
const gitService: GitService = await getFromContainerAsync(GitService);
|
||||
const args: string[] = process.argv.slice(2);
|
||||
const args: string[] = argv.stripSparoArgs(process.argv.slice(2));
|
||||
gitService.executeGitCommand({
|
||||
args
|
||||
});
|
||||
|
|
|
@ -66,11 +66,6 @@ export class CheckoutCommand implements ICommand<ICheckoutCommandOptions> {
|
|||
args: ArgumentsCamelCase<ICheckoutCommandOptions>,
|
||||
terminalService: TerminalService
|
||||
): Promise<void> => {
|
||||
console.log(JSON.stringify(args, null, 2));
|
||||
const a: number = 1;
|
||||
if (a > 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
const { _gitService: gitService, _localState: localState } = this;
|
||||
const { b, B, branch, startPoint } = args;
|
||||
|
||||
|
|
|
@ -31,6 +31,17 @@ export class ArgvService {
|
|||
return String(this._parsed._[0] || '');
|
||||
}
|
||||
|
||||
public stripSparoArgs(args: string[]): string[] {
|
||||
const newArgs: string[] = [];
|
||||
for (const arg of args) {
|
||||
if (['--debug', '--verbose'].includes(arg)) {
|
||||
continue;
|
||||
}
|
||||
newArgs.push(arg);
|
||||
}
|
||||
return newArgs;
|
||||
}
|
||||
|
||||
private _terminalMiddleware: MiddlewareFunction<{
|
||||
debug: boolean | undefined;
|
||||
verbose: boolean | undefined;
|
||||
|
|
Loading…
Reference in a new issue