Skip to content

Commit

Permalink
fix: Support FIREFOX_BINARY again for Running web extension from /hom…
Browse files Browse the repository at this point in the history
…e/sj/Desktop/FOSS/Mozilla/web-ext

run: InvalidManifest: Could not read manifest.json file at /home/sj/Desktop/FOSS/Mozilla/web-ext/manifest.json: Error: ENOENT: no such file or directory, open '/home/sj/Desktop/FOSS/Mozilla/web-ext/manifest.json'
    at _callee$ (/home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/src/util/manifest.js:30:11)
    at tryCatch (/home/sj/Desktop/FOSS/Mozilla/web-ext/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/sj/Desktop/FOSS/Mozilla/web-ext/node_modules/regenerator-runtime/runtime.js:336:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/home/sj/Desktop/FOSS/Mozilla/web-ext/node_modules/regenerator-runtime/runtime.js:95:21)
    at step (/home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:17:1)
    at /home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:30:1
    at run (/home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/~/core-js/library/modules/es6.promise.js:87:1)
    at /home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/~/core-js/library/modules/es6.promise.js:100:1
    at flush (/home/sj/Desktop/FOSS/Mozilla/web-ext/dist/webpack:/~/core-js/library/modules/_microtask.js:18:1)
    at nextTickCallbackWith0Args (node.js:420:9)
  • Loading branch information
shubheksha committed Sep 24, 2016
1 parent 80c59df commit 5ca50fa
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Example: $0 --help run.
})
.command('run', 'Run the web extension', commands.run, {
'firefox': {
alias: 'f',
alias: ['f', 'firefox-binary'],
describe: 'Path to a Firefox executable such as firefox-bin. ' +
'If not specified, the default Firefox will be used.',
demand: false,
Expand Down
41 changes: 41 additions & 0 deletions tests/functional/test.cli.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,44 @@ describe('web-ext run', () => {
});
}));
});

describe('web-ext run', () => {
it(
'should accept: --no-reload --source-dir SRCDIR --firefox-binary FXPATH',
() => withTempAddonDir(
{addonPath: addonPath},
(srcDir) => {
const argv = [
'run', '--verbose', '--no-reload',
'--source-dir', srcDir,
'--firefox-binary', fakeFirefoxPath,
];
const spawnOptions = {
env: {
PATH: process.env.PATH,
EXPECTED_MESSAGE: EXPECTED_MESSAGE,
addonPath: srcDir,
},
};

const cmd = runCommand(webExt, argv, spawnOptions);

return cmd.waitForExit.then(({exitCode, stdout, stderr}) => {
if (stdout.indexOf(EXPECTED_MESSAGE) < 0) {
reportRunCommandError({
argv,
exitCode,
stdout,
stderr,
}, 'The fake Firefox binary has not been executed');
} else if (exitCode !== 0) {
reportRunCommandError({
argv,
exitCode,
stdout,
stderr,
});
}
});
}));
});

0 comments on commit 5ca50fa

Please sign in to comment.