Skip to content

Commit e34efa1

Browse files
committed
Revert "fix: replace bash postinstall with Node.js for Windows compatibility"
This reverts commit a6d9dee.
1 parent ac7bece commit e34efa1

3 files changed

Lines changed: 8 additions & 118 deletions

File tree

vendor/scripts/npm-utoo.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@ cat "$ENTRY_DIR/package.json" | \
2828
print;
2929
}' > "$ENTRY_DIR/package.json.tmp" && mv "$ENTRY_DIR/package.json.tmp" "$ENTRY_DIR/package.json"
3030

31-
# copy postinstall script (Node.js for cross-platform compatibility)
32-
cp ../templates/postinstall.js.template "$ENTRY_DIR/postinstall.js"
31+
# do copy postinstall.sh
32+
cp ../templates/postinstall.utoo.sh.template "$ENTRY_DIR/postinstall.sh"
33+
chmod +x "$ENTRY_DIR/postinstall.sh"
3334

3435
# copy README.md from repository root
3536
cp ../../README.md "$ENTRY_DIR/README.md"
3637

3738
# create placeholder binaries
3839
mkdir -p "$ENTRY_DIR/bin"
3940
for binary in utoo ut; do
40-
# Unix version (use /bin/sh for portability)
41+
# Unix version
4142
cat > "$ENTRY_DIR/bin/$binary" << 'EOF'
42-
#!/bin/sh
43-
echo "This is a placeholder binary. The actual binary will be installed via postinstall script."
43+
#!/bin/bash
44+
echo "This is a placeholder binary for $binary. The actual binary will be installed via postinstall script."
4445
exit 1
4546
EOF
4647
chmod +x "$ENTRY_DIR/bin/$binary"
@@ -55,7 +56,7 @@ done
5556

5657
# create utx shell script that executes utoo x
5758
cat > "$ENTRY_DIR/bin/utx" << 'EOF'
58-
#!/bin/sh
59+
#!/bin/bash
5960
utoo x "$@"
6061
EOF
6162
chmod +x "$ENTRY_DIR/bin/utx"

vendor/templates/postinstall.js.template

Lines changed: 0 additions & 111 deletions
This file was deleted.

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": "node ./postinstall.js"
24+
"postinstall": "bash ./postinstall.sh"
2525
}
2626
}

0 commit comments

Comments
 (0)