Skip to content

Commit fee7f2b

Browse files
committed
Use sh instead of bash in Node hook, for alpine compatibility
1 parent 53646df commit fee7f2b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

overrides/path/node

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
2+
# ^ Note that we use sh, not bash, for alpine compatibility
23
set -e
34

45
# Exclude ourselves from PATH, find the real node, then reset PATH
5-
PATH="${PATH//`dirname "$0"`:/}"
6+
PATH="$(printf '%s\n' "$PATH" | sed "s:$(dirname "$0")\:::g")"
7+
# ^ This is made more complicated by sh, since we can't use variable expansion, but this
8+
# should be equivalent. We use : as a safe sed delim here, though it is confusing!
9+
610
real_node=`command -v node`
711
PATH="`dirname "$0"`:$PATH"
812

0 commit comments

Comments
 (0)