mozilla / lightbeam-we

Web Extension version of the Firefox Lightbeam add-on
https://addons.mozilla.org/en-GB/firefox/addon/lightbeam/
Mozilla Public License 2.0
178 stars 61 forks source link

npm scripts don't build correctly on windows #226

Open qfulsher opened 6 years ago

qfulsher commented 6 years ago

The current scripts for the npm run build command use rm and cp which don't exist in cmd.exe. I've been able to make the build work by utilizing shx. I could make a pull request if you guys don't mind taking a dependency on shx.

jonathanKingston commented 6 years ago

I don't really know what that is, can't you use a MINGW based setup like git bash instead?

Is the build script the only thing that is broken?

qfulsher commented 6 years ago

From what I understand shx just allows you to write cross-platform shell scripts. For example, here's one of the current build scripts:

"createlib": "cd src && rm -rf ext-libs && mkdir ext-libs && npm run movelibcontents",

This script works fine in cmd except for the rm -rf. cmd doesn't understand the rm command so this would fail on a windows machine. Here's the modified version using shx:

"createlib": "cd src && shx rm -rf ext-libs && mkdir ext-libs && npm run movelibcontents",

Installing shx and then using this script will build correctly on both bash and cmd shells. I also think that shx supports more than just windows and bash.

And yes building the unmodified version on MINGW should work just fine. This is just a bit less complicated for a windows user.

jonathanKingston commented 6 years ago

I use Windows as my default (granted this is a recent change), I wouldn't ever touch cmd where possible. I'm worried this small change will lead to us maintaining a build that very few people will use and will be untested.

I would rather provide windows users a docker setup or guide on using mingw than maintaining another code branch. I'm happy to leave this open for other peoples views though, to see if there is enough interest.

vanowm commented 4 years ago

Would be nice if you provided a guide... P.S. I really don't understand the point of "building/compiling" a browser extension, while we could simply modify the already "built" source...