mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Support Windows in install-safe-shain.sh (git bash, cygwin, ...)
This commit is contained in:
parent
f283b72a11
commit
cf57a98b54
1 changed files with 16 additions and 5 deletions
|
|
@ -42,8 +42,9 @@ detect_os() {
|
||||||
echo "linuxstatic"
|
echo "linuxstatic"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
Darwin*) echo "macos" ;;
|
Darwin*) echo "macos" ;;
|
||||||
*) error "Unsupported operating system: $(uname -s)" ;;
|
MINGW*|MSYS*|CYGWIN*) echo "win" ;;
|
||||||
|
*) error "Unsupported operating system: $(uname -s)" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,7 +294,11 @@ main() {
|
||||||
# Detect platform
|
# Detect platform
|
||||||
OS=$(detect_os)
|
OS=$(detect_os)
|
||||||
ARCH=$(detect_arch)
|
ARCH=$(detect_arch)
|
||||||
BINARY_NAME="safe-chain-${OS}-${ARCH}"
|
if [ "$OS" = "win" ]; then
|
||||||
|
BINARY_NAME="safe-chain-${OS}-${ARCH}.exe"
|
||||||
|
else
|
||||||
|
BINARY_NAME="safe-chain-${OS}-${ARCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
info "Detected platform: ${OS}-${ARCH}"
|
info "Detected platform: ${OS}-${ARCH}"
|
||||||
|
|
||||||
|
|
@ -311,9 +316,15 @@ main() {
|
||||||
download "$DOWNLOAD_URL" "$TEMP_FILE"
|
download "$DOWNLOAD_URL" "$TEMP_FILE"
|
||||||
|
|
||||||
# Rename and make executable
|
# Rename and make executable
|
||||||
FINAL_FILE="${INSTALL_DIR}/safe-chain"
|
if [ "$OS" = "win" ]; then
|
||||||
|
FINAL_FILE="${INSTALL_DIR}/safe-chain.exe"
|
||||||
|
else
|
||||||
|
FINAL_FILE="${INSTALL_DIR}/safe-chain"
|
||||||
|
fi
|
||||||
mv "$TEMP_FILE" "$FINAL_FILE" || error "Failed to move binary to $FINAL_FILE"
|
mv "$TEMP_FILE" "$FINAL_FILE" || error "Failed to move binary to $FINAL_FILE"
|
||||||
chmod +x "$FINAL_FILE" || error "Failed to make binary executable"
|
if [ "$OS" != "win" ]; then
|
||||||
|
chmod +x "$FINAL_FILE" || error "Failed to make binary executable"
|
||||||
|
fi
|
||||||
|
|
||||||
info "Binary installed to: $FINAL_FILE"
|
info "Binary installed to: $FINAL_FILE"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue