2024-04-26 01:32:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ! "$BASH_VERSION" ] ; then
|
|
|
|
bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
warencli-syntax-line-douple() {
|
|
|
|
echo -n "
|
|
|
|
==============================
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
|
|
|
warencli-syntax-line-single() {
|
|
|
|
echo -n "
|
|
|
|
------------------------------
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
|
|
|
warencli-start() {
|
|
|
|
warencli-syntax-line-douple
|
|
|
|
echo -n "Warén CLI "
|
|
|
|
warencli-syntax-line-douple
|
|
|
|
}
|
|
|
|
|
|
|
|
warencli-stop () {
|
|
|
|
echo " "
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
warencli-update() {
|
|
|
|
if [[ -d "./src" ]]; then
|
|
|
|
echo ">>> Building... <<<"
|
|
|
|
podman run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp docker.io/library/php:8-cli php generator.php
|
|
|
|
else
|
2024-04-26 01:58:29 +00:00
|
|
|
echo ">>> Updating... <<<"
|
|
|
|
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
|
2024-04-26 01:32:38 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
{{ COMMANDS }}
|
|
|
|
|
|
|
|
COMMAND=$1
|
|
|
|
|
|
|
|
warencli-start
|
|
|
|
if [[ ! -z $1 ]]; then
|
|
|
|
warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9
|
|
|
|
fi
|
|
|
|
warencli-stop
|