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