Skip to content

Commit ae1c297

Browse files
elrrrrrrrclaude
andcommitted
fix: use sh instead of bash for postinstall and bin placeholders
bash may not be in PATH on Windows (only Git Bash's sh is guaranteed). - Change postinstall from bash to sh in package.json - Convert [[ ]] to POSIX [ ] in postinstall templates - Change placeholder shebangs from #!/bin/bash to #!/bin/sh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e34efa1 commit ae1c297

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

vendor/scripts/npm-utoo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ mkdir -p "$ENTRY_DIR/bin"
4040
for binary in utoo ut; do
4141
# Unix version
4242
cat > "$ENTRY_DIR/bin/$binary" << 'EOF'
43-
#!/bin/bash
44-
echo "This is a placeholder binary for $binary. The actual binary will be installed via postinstall script."
43+
#!/bin/sh
44+
echo "This is a placeholder binary. The actual binary will be installed via postinstall script."
4545
exit 1
4646
EOF
4747
chmod +x "$ENTRY_DIR/bin/$binary"
@@ -56,7 +56,7 @@ done
5656

5757
# create utx shell script that executes utoo x
5858
cat > "$ENTRY_DIR/bin/utx" << 'EOF'
59-
#!/bin/bash
59+
#!/bin/sh
6060
utoo x "$@"
6161
EOF
6262
chmod +x "$ENTRY_DIR/bin/utx"

vendor/templates/postinstall.sh.template

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# get cpu & os info
4-
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
5-
OS="win32"
4+
if [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "win32" ]; then
5+
OS="win32"
66
# Use PROCESSOR_ARCHITECTURE on Windows
7-
if [[ "$PROCESSOR_ARCHITECTURE" == "AMD64" ]] || [[ "$PROCESSOR_ARCHITECTURE" == "x86_64" ]]; then
8-
ARCH="x64"
9-
elif [[ "$PROCESSOR_ARCHITECTURE" == "ARM64" ]]; then
10-
ARCH="arm64"
11-
else
12-
ARCH="x64"
13-
fi
7+
if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" ] || [ "$PROCESSOR_ARCHITECTURE" = "x86_64" ]; then
8+
ARCH="x64"
9+
elif [ "$PROCESSOR_ARCHITECTURE" = "ARM64" ]; then
10+
ARCH="arm64"
11+
else
12+
ARCH="x64"
13+
fi
1414
else
1515
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1616
ARCH=$(uname -m)

vendor/templates/postinstall.utoo.sh.template

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

3-
# Get CPU & OS info - compatible with Git Bash on Windows
4-
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
5-
OS="win32"
6-
# On Windows, use PROCESSOR_ARCHITECTURE
7-
if [[ "$PROCESSOR_ARCHITECTURE" == "AMD64" ]] || [[ "$PROCESSOR_ARCHITECTURE" == "x86_64" ]]; then
8-
ARCH="x64"
9-
elif [[ "$PROCESSOR_ARCHITECTURE" == "ARM64" ]]; then
10-
ARCH="arm64"
11-
else
12-
ARCH="x64" # default
13-
fi
3+
# Get CPU & OS info - POSIX compatible (works with sh on Windows Git)
4+
if [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "win32" ]; then
5+
OS="win32"
6+
# On Windows, use PROCESSOR_ARCHITECTURE
7+
if [ "$PROCESSOR_ARCHITECTURE" = "AMD64" ] || [ "$PROCESSOR_ARCHITECTURE" = "x86_64" ]; then
8+
ARCH="x64"
9+
elif [ "$PROCESSOR_ARCHITECTURE" = "ARM64" ]; then
10+
ARCH="arm64"
11+
else
12+
ARCH="x64" # default
13+
fi
1414
else
1515
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1616
ARCH=$(uname -m)

vendor/templates/utoo.package.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"os": ["darwin", "linux", "win32"],
2222
"cpu": ["x64", "arm64"],
2323
"scripts": {
24-
"postinstall": "bash ./postinstall.sh"
24+
"postinstall": "sh ./postinstall.sh"
2525
}
2626
}

0 commit comments

Comments
 (0)