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
f358709ab2
commit
99cd416628
1 changed files with 16 additions and 5 deletions
|
|
@ -43,6 +43,7 @@ detect_os() {
|
|||
fi
|
||||
;;
|
||||
Darwin*) echo "macos" ;;
|
||||
MINGW*|MSYS*|CYGWIN*) echo "win" ;;
|
||||
*) error "Unsupported operating system: $(uname -s)" ;;
|
||||
esac
|
||||
}
|
||||
|
|
@ -293,7 +294,11 @@ main() {
|
|||
# Detect platform
|
||||
OS=$(detect_os)
|
||||
ARCH=$(detect_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}"
|
||||
|
||||
|
|
@ -311,9 +316,15 @@ main() {
|
|||
download "$DOWNLOAD_URL" "$TEMP_FILE"
|
||||
|
||||
# Rename and make executable
|
||||
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"
|
||||
if [ "$OS" != "win" ]; then
|
||||
chmod +x "$FINAL_FILE" || error "Failed to make binary executable"
|
||||
fi
|
||||
|
||||
info "Binary installed to: $FINAL_FILE"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue