Closed h-enk closed 3 years ago
OK, I got it.
script-shell: default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
I've added a script to use Powershell: "init:windows": "npm config set script-shell pwsh --userconfig ./.npmrc"
. Will try to automate this.
Yeah, some time ago I also discovered that running executable (.exe
) files from within an npm script sadly does not work on Windows.
At that time I decided to write a tiny npm library that allows me to do exactly that: https://github.com/dominique-mueller/exec-bin. With that library, you just need to prepend exec-bin
to every command. For instance, to check the version:
exec-bin bin/hugo/hugo version
I will probably extend the README docs to cover this.
Ah brilliant /way better solution — thanks!
I'm surely going to make the switch to hugo-installer for Doks!
@dominique-mueller, nice work! I'm considering using hugo-installer in Doks, however I can't get it to work — on Windows.
Running
bin/hugo/hugo version
works for me from the command line, but not as part of an npm script (on Windows):I'm using Node.js v16.3.0 /npm v7.16.0
How would I get this to work — cross platform?
POC: https://github.com/h-enk/hugo-installer-poc