Closed noah-weingarden closed 2 years ago
Good call! I agree with you, I think we should just drop the SIG
prefix if it works across shells. I'd welcome a PR if you have the bandwidth to do so 😃
Just made one!
On a similar note, .githooks/pre-commit
doesn't work with dash, as set -o pipefail
is an illegal option. When I tried switching to bash, the script exited 1 when it reached the line MINOR_VERSION=$(cat $PROJECT_ROOT/VERSION | grep -o "\d\.\d")
.
It's because dirname /home/noah/primer-spec
outputs /home/noah
, which doesn't have a VERSION
file.
On a similar note,
.githooks/pre-commit
doesn't work with dash, asset -o pipefail
is an illegal option.
I think we can safely remove the pipefail
option. Do you see other errors in dash after removing that?
It's because
dirname /home/noah/primer-spec
outputs/home/noah
, which doesn't have aVERSION
file.
Hmm… the pre-commit hook is supposed to find its own directory and then find the project root from there.
Could you try adding echo
statements to check the value of the variables and working directories? I’m currently suspecting that dirname $0
isn’t working as I expected, but I don’t know for sure…
(I’ve only ever tested the builds and scripts on bash
on my Mac 😅 )
Could you try adding echo statements to check the value of the variables and working directories?
Good call! Sorry, I was lazy last night and misinterpreted the error: dirname
is working fine. The real issue is that my version of grep doesn't recognize \d
, since it's not part of basic regular expressions. Switching to grep -o "[[:digit:]]\.[[:digit:]]"
or grep -o "[0-9]\.[0-9]"
might make the script more cross-platform.
I think we can safely remove the pipefail option. Do you see other errors in dash after removing that?
Apparently dash doesn't have a pushd
command. 🤷
This will be fixed when #195 is merged.
When I run
./script/server
as-is, I see the following error:I believe this is because
sh
on my machine doesn't supportSIG
-prefixed signal names. On my machine,sh
is dash. Is it problematic to use bash instead? Also, would dropping the prefixes make the script more cross-platform?