Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/cmd/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ export default function run(
'--pre-install');
noReload = true;
}
// When not pre-installing the extension, we require a remote
// connection to Firefox.
const requiresRemote = !preInstall;

function createRunner() {
return getValidatedManifest(sourceDir)
Expand Down Expand Up @@ -142,19 +145,24 @@ export default function run(
});
})
.then((config) => {
return firefoxClient().then((client) => {
return {client, ...config};
});
if (requiresRemote) {
return firefoxClient().then((client) => {
return {client, ...config};
});
} else {
return config;
}
})
.then((config) => {
return new Promise(
(resolve) => {
const {runner, client} = config;
const {runner} = config;
if (installed) {
log.debug('Not installing as temporary add-on because the ' +
'add-on was already installed');
resolve();
} else {
const {client} = config;
resolve(runner.installAsTemporaryAddon(client));
}
})
Expand Down
9 changes: 9 additions & 0 deletions tests/test-cmd/test.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ describe('run', () => {
});
});

it('will not connect to the debugger when using --pre-install', () => {
const cmd = prepareRun();
const {firefoxClient} = cmd.options;

return cmd.run({preInstall: true}).then(() => {
assert.equal(firefoxClient.called, false);
});
});

it('allows you to opt out of extension reloading', () => {
const cmd = prepareRun();
const {reloadStrategy} = cmd.options;
Expand Down