fix: remove redundant sudo commands from setup.sh
- Removed sudo from Node.js installation commands (curl ... | bash -) - Script already runs as root (check_root enforced at start) - Redundant sudo commands are unnecessary when script has root privileges - Applied to both apt-get and yum package managers
This commit is contained in:
@@ -60,12 +60,12 @@ check_prerequisites() {
|
||||
;;
|
||||
node)
|
||||
# Install Node.js 24.x from NodeSource
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo bash -
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
|
||||
apt-get install -y nodejs
|
||||
;;
|
||||
npm)
|
||||
# npm comes with nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo bash -
|
||||
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
|
||||
apt-get install -y nodejs
|
||||
;;
|
||||
esac
|
||||
@@ -73,7 +73,7 @@ check_prerequisites() {
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
yum install -y python3 python3-pip git systemd
|
||||
# Install Node.js 24.x
|
||||
curl -fsSL https://rpm.nodesource.com/setup_24.x | sudo bash -
|
||||
curl -fsSL https://rpm.nodesource.com/setup_24.x | bash -
|
||||
yum install -y nodejs
|
||||
else
|
||||
error "Unsupported package manager. Please install manually: ${missing[*]}"
|
||||
|
||||
Reference in New Issue
Block a user