lightbeam-we icon indicating copy to clipboard operation
lightbeam-we copied to clipboard

npm scripts don't build correctly on windows

Open qfulsher opened this issue 8 years ago • 4 comments

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.

qfulsher avatar Oct 10 '17 02:10 qfulsher

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?

jonathanKingston avatar Oct 10 '17 03:10 jonathanKingston

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.

qfulsher avatar Oct 10 '17 03:10 qfulsher

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.

jonathanKingston avatar Oct 10 '17 03:10 jonathanKingston

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...

vanowm avatar Feb 02 '20 13:02 vanowm