|
|
@ -60,14 +60,14 @@ set_node_to() { |
|
|
|
nvm use default |
|
|
|
nvm use default |
|
|
|
fi |
|
|
|
fi |
|
|
|
else |
|
|
|
else |
|
|
|
echo "nvm not available, something went wrong..." |
|
|
|
say "nvm not available, something went wrong..." |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
install_nvm() { |
|
|
|
install_nvm() { |
|
|
|
say "${BOLD}Installing Node Version Manager${RESET}" |
|
|
|
say "${BOLD}Installing Node Version Manager${RESET}" |
|
|
|
if [ -d "$NVM_DIR" ]; then |
|
|
|
if [ -d "$NVM_DIR" ]; then |
|
|
|
echo "nvm already installed! skipping" |
|
|
|
say "nvm already installed! skipping" |
|
|
|
else |
|
|
|
else |
|
|
|
chmod +x scripts/nvm_install.sh |
|
|
|
chmod +x scripts/nvm_install.sh |
|
|
|
scripts/nvm_install.sh &> /dev/null |
|
|
|
scripts/nvm_install.sh &> /dev/null |
|
|
@ -81,7 +81,7 @@ install_nvm() { |
|
|
|
build_service_from_template() { |
|
|
|
build_service_from_template() { |
|
|
|
SERVICE=$1 |
|
|
|
SERVICE=$1 |
|
|
|
shift |
|
|
|
shift |
|
|
|
echo "" |
|
|
|
say "" |
|
|
|
if [ -f resources/service-templates/${SERVICE} ]; then |
|
|
|
if [ -f resources/service-templates/${SERVICE} ]; then |
|
|
|
say "Creating $SERVICE.service..." |
|
|
|
say "Creating $SERVICE.service..." |
|
|
|
SERVICE_FILE=/etc/systemd/system/${SERVICE}.service |
|
|
|
SERVICE_FILE=/etc/systemd/system/${SERVICE}.service |
|
|
@ -105,8 +105,8 @@ build_service_from_template() { |
|
|
|
sudo sed -i "s#USER#${USER}#g" $SERVICE_FILE |
|
|
|
sudo sed -i "s#USER#${USER}#g" $SERVICE_FILE |
|
|
|
sudo sed -i "s#HOME#${HOME}#g" $SERVICE_FILE |
|
|
|
sudo sed -i "s#HOME#${HOME}#g" $SERVICE_FILE |
|
|
|
for keyval; do |
|
|
|
for keyval; do |
|
|
|
KEY=$(echo $keyval | cut -d'=' -f 1) |
|
|
|
KEY=$(say $keyval | cut -d'=' -f 1) |
|
|
|
VAL=$(echo $keyval | cut -d'=' -f 2) |
|
|
|
VAL=$(say $keyval | cut -d'=' -f 2) |
|
|
|
|
|
|
|
|
|
|
|
say "Substituting $KEY for $VAL" |
|
|
|
say "Substituting $KEY for $VAL" |
|
|
|
sudo sed -i "s#$KEY#$VAL#g" $SERVICE_FILE |
|
|
|
sudo sed -i "s#$KEY#$VAL#g" $SERVICE_FILE |
|
|
|