Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change --firefox-binary to --firefox #116

Closed
kumar303 opened this issue Mar 7, 2016 · 13 comments
Closed

Change --firefox-binary to --firefox #116

kumar303 opened this issue Mar 7, 2016 · 13 comments

Comments

@kumar303
Copy link
Contributor

kumar303 commented Mar 7, 2016

web-ext run --firefox=/path/to/firefox-bin seems more concise. We should also give it a short alias like -f.

@kumar303
Copy link
Contributor Author

we should fix #169 first to avoid confusion when users upgrade their web-ext for this option change

@shubheksha
Copy link
Contributor

For this issue, I need to modify this line & add an alias property like it has been included for other commands -- am I on the right track?

@kumar303
Copy link
Contributor Author

Yes, I think that's the way to go.

@shubheksha
Copy link
Contributor

I made the required changes & they're being reflected using the --help option. However, I am unable to test it & running into the following error. I've attached the screenshot for reference.
image

@kumar303
Copy link
Contributor Author

You should be able to use any of these extensions to test it: https://github.com/mdn/webextensions-examples/ You will need to cd into the source directory of one of the examples before executing web-ext run.

@kumar303
Copy link
Contributor Author

One thing that may not be obvious is that yargs has some magic that was turning --firefox-binary into the config key firefoxBinary when executing run(). The run() signature probably also needs updating.

@shubheksha
Copy link
Contributor

I am a little confused -- the variable firefoxBinary is strewn all over in this file. What about those?

@kumar303
Copy link
Contributor Author

Let's say you typed:

web-ext run --firefox-binary /Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin

This would invoke:

cmd.run({firefoxBinary: '/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin', ...});

The variable is passed around to a few things that utilize the Firefox executable path.

@shubheksha
Copy link
Contributor

Okay, that makes sense. But I don't really understand the flow even now.
As you mentioned above, the config key firefoxBinary was being created by yargs on its own, so changing the option to --firefox should also work in a similar manner? I am sorry if this sounds stupid -- I am a little lost. I went through the yargs docs as well, but didn't find an answer to how this is being done.
From what I understood, --firefox will be changed to firefox, but that variable is already present in the file in multiple places.

@kumar303
Copy link
Contributor Author

From what I understood, --firefox will be changed to firefox,

Yes, that's correct. It's not very well documented in yargs but if you log the argv variable you could see the complete object after yargs is done doing the magic translation.

but that variable is already present in the file in multiple places.

Ah, good point. I see the problem now. There is already an option defined as firefox=defaultFirefox so the new yargs generated firefox variable will conflict. I think you'll need to rename this everywhere that it's used. Something like firefoxApp=defaultFirefox probably makes sense.

@shubheksha
Copy link
Contributor

Firefox can't be found for some reason. Changing the variable names broke something, I guess. Despite giving it the full path to the .exe, it won't work. Hence, the builds are failing too. How can I go about finding what exactly broke?

@kumar303
Copy link
Contributor Author

The run command docs will need updating but we should wait until a new version of web-ext is released containing this change.

@kumar303
Copy link
Contributor Author

I updated the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants