curl checks
This commit is contained in:
parent
64dbd2f460
commit
3502858ce2
2 changed files with 25 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ log() {
|
||||||
|
|
||||||
SCRIPT_VERSION="0.2.3
|
SCRIPT_VERSION="0.2.3
|
||||||
REPO="shocknet/Lightning.Pub"
|
REPO="shocknet/Lightning.Pub"
|
||||||
BRANCH="master"
|
BRANCH="wizard-update
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
log "Cleaning up temporary files..."
|
log "Cleaning up temporary files..."
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,30 @@ install_nodejs() {
|
||||||
log "${PRIMARY_COLOR}Checking${RESET_COLOR} for Node.js..."
|
log "${PRIMARY_COLOR}Checking${RESET_COLOR} for Node.js..."
|
||||||
MINIMUM_VERSION="18.0.0"
|
MINIMUM_VERSION="18.0.0"
|
||||||
|
|
||||||
|
# Check for curl (required by nvm installer)
|
||||||
|
if ! command -v curl &> /dev/null; then
|
||||||
|
log "ERROR: curl is required for Node.js installation"
|
||||||
|
log ""
|
||||||
|
log "Please install curl first:"
|
||||||
|
log " Debian/Ubuntu: sudo apt install curl"
|
||||||
|
log " Fedora/RHEL: sudo dnf install curl"
|
||||||
|
log " Arch: sudo pacman -S curl"
|
||||||
|
log ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for snap curl which cannot access hidden folders
|
||||||
|
if snap list 2>/dev/null | grep -q "^curl "; then
|
||||||
|
log "ERROR: Snap curl detected"
|
||||||
|
log ""
|
||||||
|
log "Snap curl cannot access hidden folders needed for Node.js installation."
|
||||||
|
log "Please remove snap curl and install native curl:"
|
||||||
|
log " sudo snap remove curl"
|
||||||
|
log " sudo apt install curl"
|
||||||
|
log ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Load nvm if it already exists
|
# Load nvm if it already exists
|
||||||
export NVM_DIR="${NVM_DIR}"
|
export NVM_DIR="${NVM_DIR}"
|
||||||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
|
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue