wx/src/base.sh
Christer Warén 8808aa7b93 Source Update
2024-04-26 06:22:52 +03:00

53 lines
949 B
Bash

#!/bin/bash
if [ ! "$BASH_VERSION" ] ; then
bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
exit 1
fi
syntax-line-douple() {
echo -n "
==============================
"
}
syntax-line-single() {
echo -n "
------------------------------
"
}
start() {
syntax-line-douple
echo -n "Warén CLI "
syntax-line-douple
}
stop () {
if [[ -d "./src" ]]
then
podman run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp docker.io/library/php:8-cli php generator.php &> /dev/null
mv wx.tmp wx &> /dev/null
chmod +x wx &> /dev/null
else
sudo curl https://git.waren.io/warengroup/wx/raw/branch/master/wx -o /opt/wx &> /dev/null
if [[ -d "/usr/bin" ]]
then
sudo ln -sf /opt/wx /usr/bin/wx &> /dev/null
fi
sudo chmod +x /usr/bin/wx &> /dev/null
fi
echo " "
echo " "
exit 1
}
COMMAND=$1
start
if [[ ! -z $1 ]] && [[ $(type -t warencli-$1) == function ]]
then
warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9
fi
stop