Remove npm-installed safe-chain

This commit is contained in:
Sander Declerck 2025-12-01 16:04:47 +01:00
parent 34c62c5268
commit 22b780ddcd
No known key found for this signature in database
2 changed files with 50 additions and 0 deletions

View file

@ -68,10 +68,33 @@ download() {
fi
}
# Check and uninstall npm global package if present
check_npm_installation() {
if ! command_exists npm; then
return
fi
# Check if safe-chain is installed as an npm global package
if npm list -g @aikidosec/safe-chain >/dev/null 2>&1; then
info "Detected npm global installation of @aikidosec/safe-chain"
info "Uninstalling npm version before installing binary version..."
if npm uninstall -g @aikidosec/safe-chain >/dev/null 2>&1; then
info "Successfully uninstalled npm version"
else
warn "Failed to uninstall npm version automatically"
warn "Please run: npm uninstall -g @aikidosec/safe-chain"
fi
fi
}
# Main installation
main() {
info "Installing safe-chain ${VERSION}..."
# Check for existing npm installation
check_npm_installation
# Detect platform
OS=$(detect_os)
ARCH=$(detect_arch)