I have this script which (I think) checks for existance of some programs and npm packages and then keeps doing stuff:
#!/bin/bash
# Functions ==============================================
function programa_instalado {
# set to 1 initially
local return_=1
# set to 0 if not found
type $1 >/dev/null 2>&1 || { local return_=0; }
# return value
echo "$return_"
}
function paquete_npm_instalado {
# set to 1 initially
local return_=1
# set to 0 if not found
ls node_modules | grep $1 >/dev/null 2>&1 || { local return_=0; }
# return value
echo "$return_"
}
function pregunta_node {
if [ $1 == 1 ]; then
$(echo "Node ya instalado")
else
$(curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -)
$(sudo apt-get install -y nodejs)
$(sudo apt-get install -y build-essential)
fi
}
function pregunta_pyinstaller {
if [ $1 == 1 ]; then
$(echo "Pyinstaller ya instalado")
else
$(pip install pyinstaller)
fi
}
function pregunta_zerorpc {
if [ $1 == 1 ]; then
$(echo "Zerorpc ya instalado")
else
$(pip install zerorpc)
fi
}
# ============================================== Functions
# command line programs
$(pregunta_node $(programa_instalado node))
$(pregunta_zerorpc $(paquete_npm_instalado zerorpc))
$(pregunta_pyinstaler $(paquete_npm_instalado pyinstaller))
$(git clone some_url)
$(cd folder)
$(npm install --runtime=electron --target=1.7.9)
$(pyinstaller server.py --distpath dist ; rm -rf build/ ; rm -rf server.spec)
$(./node_modules/.bin/electron-packager . --overwrite)
The problem is That the excecution hangs forever. I don’t know what could be possibly wrong