101
102
export function addArg(argv: string[], ...args: string[]): string[] {
103
>
const endOfArgsMarkerIndex = argv.indexOf('--');
argvHelper.ts
104
>
if (endOfArgsMarkerIndex === -1) {
105
>
argv.push(...args);
106
>
} else {
107
>
// if the we have an argument "--" (end of argument marker)
108
>
// we cannot add arguments at the end. rather, we add
109
>
// arguments before the "--" marker.
110
>
argv.splice(endOfArgsMarkerIndex, 0, ...args);
111
>
}
112
>
113
>
return argv;
114
>
}
115
116
export function isLaunchedFromCli(env: IProcessEnvironment): boolean {