Check for volta installation

This commit is contained in:
Sander Declerck 2025-12-02 08:43:38 +01:00
parent 22b780ddcd
commit eddb4f3f75
No known key found for this signature in database
2 changed files with 52 additions and 0 deletions

View file

@ -88,6 +88,27 @@ check_npm_installation() {
fi
}
# Check and uninstall Volta-managed package if present
check_volta_installation() {
if ! command_exists volta; then
return
fi
# Volta manages global packages in its own directory
# Check if safe-chain is installed via Volta
if volta list @aikidosec/safe-chain >/dev/null 2>&1; then
info "Detected Volta installation of @aikidosec/safe-chain"
info "Uninstalling Volta version before installing binary version..."
if volta uninstall @aikidosec/safe-chain >/dev/null 2>&1; then
info "Successfully uninstalled Volta version"
else
warn "Failed to uninstall Volta version automatically"
warn "Please run: volta uninstall @aikidosec/safe-chain"
fi
fi
}
# Main installation
main() {
info "Installing safe-chain ${VERSION}..."
@ -95,6 +116,9 @@ main() {
# Check for existing npm installation
check_npm_installation
# Check for existing Volta installation
check_volta_installation
# Detect platform
OS=$(detect_os)
ARCH=$(detect_arch)