forward extraArgs to app

This commit is contained in:
Joao Moreno 2018-04-11 12:20:37 +02:00
parent 72bd5854c8
commit 1b2f1980c4
2 changed files with 15 additions and 9 deletions

View file

@ -119,7 +119,8 @@ export class SpectronApplication {
workspacePath: workspaceOrFolder,
userDataDir: this.options.userDataDir,
extensionsPath: this.options.extensionsPath,
verbose: this.options.verbose
verbose: this.options.verbose,
extraArgs
});
const driver = new CodeDriver(this.codeInstance.driver, this.options.verbose);

View file

@ -72,14 +72,6 @@ export class Code {
}
}
export interface SpawnOptions {
codePath?: string;
workspacePath: string;
userDataDir: string;
extensionsPath: string;
verbose: boolean;
}
export async function connect(child: cp.ChildProcess, outPath: string, handlePath: string): Promise<Code> {
let errCount = 0;
@ -103,6 +95,15 @@ export async function connect(child: cp.ChildProcess, outPath: string, handlePat
const instances = new Set<cp.ChildProcess>();
process.once('exit', () => instances.forEach(code => code.kill()));
export interface SpawnOptions {
codePath?: string;
workspacePath: string;
userDataDir: string;
extensionsPath: string;
verbose: boolean;
extraArgs?: string[];
}
export async function spawn(options: SpawnOptions): Promise<Code> {
const codePath = options.codePath;
const electronPath = codePath ? getBuildElectronPath(codePath) : getDevElectronPath();
@ -126,6 +127,10 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
args.unshift(repoPath);
}
if (options.extraArgs) {
args.push(...options.extraArgs);
}
const spawnOptions: cp.SpawnOptions = {};
if (options.verbose) {