Source Update

This commit is contained in:
Christer Warén 2024-04-26 06:20:28 +03:00
parent d99860148b
commit d3901ba519
4 changed files with 48 additions and 58 deletions

View File

@ -5,50 +5,49 @@ if [ ! "$BASH_VERSION" ] ; then
exit 1 exit 1
fi fi
warencli-syntax-line-douple() { syntax-line-douple() {
echo -n " echo -n "
============================== ==============================
" "
} }
warencli-syntax-line-single() { syntax-line-single() {
echo -n " echo -n "
------------------------------ ------------------------------
" "
} }
warencli-start() { start() {
warencli-syntax-line-douple syntax-line-douple
echo -n "Warén CLI " echo -n "Warén CLI "
warencli-syntax-line-douple syntax-line-douple
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
} }
warencli-stop () { stop () {
echo " " echo " "
echo " " echo " "
exit 1 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 &> /dev/null
mv wx.tmp wx
chmod +x wx
else
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
fi
}
COMMAND=$1 COMMAND=$1
warencli-start start
if [[ ! -z $1 ]]; then if [[ ! -z $1 ]] && [[ $(type -t warencli-$1) == function ]]
then
warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9 warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9
fi fi
warencli-stop stop

View File

@ -13,10 +13,5 @@ Authentication Commands:
Management Commands: Management Commands:
settings Settings settings Settings
Maintenance Commands:
install Install
update Update
"; ";
} }

View File

@ -1,3 +0,0 @@
warencli-install() {
echo ">>> Install";
}

49
wx
View File

@ -5,50 +5,49 @@ if [ ! "$BASH_VERSION" ] ; then
exit 1 exit 1
fi fi
warencli-syntax-line-douple() { syntax-line-douple() {
echo -n " echo -n "
============================== ==============================
" "
} }
warencli-syntax-line-single() { syntax-line-single() {
echo -n " echo -n "
------------------------------ ------------------------------
" "
} }
warencli-start() { start() {
warencli-syntax-line-douple syntax-line-douple
echo -n "Warén CLI " echo -n "Warén CLI "
warencli-syntax-line-douple syntax-line-douple
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
} }
warencli-stop () { stop () {
echo " " echo " "
echo " " echo " "
exit 1 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 &> /dev/null
mv wx.tmp wx
chmod +x wx
else
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
fi
}
COMMAND=$1 COMMAND=$1
warencli-start start
if [[ ! -z $1 ]]; then if [[ ! -z $1 ]] && [[ $(type -t warencli-$1) == function ]]
then
warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9 warencli-$1 $2 $3 $4 $5 $6 $7 $8 $9
fi fi
warencli-stop stop