From 0ff81837f993e9000457fc2b604cb58d9e44efd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 6 Jun 2024 03:03:11 +0300 Subject: [PATCH] Replace separate scripts with Maintainer script --- build.sh | 26 -------------------------- maintainer.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ update.sh | 27 --------------------------- 3 files changed, 49 insertions(+), 53 deletions(-) delete mode 100755 build.sh create mode 100755 maintainer.sh delete mode 100755 update.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 69a7280..0000000 --- a/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ ! "$BASH_VERSION" ] ; then - bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 - exit 1 -fi - -wiBold=$(tput bold) -wiNormal=$(tput sgr0) - -echo "" -echo "" -echo "" -echo "==============================" -echo -n "$wiBold" -echo " Warén Group " -echo -n "$wiNormal" -echo "==============================" -echo " >> Init << " -echo "------------------------------" -podman run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp docker.io/library/php:8-cli php generator.php &> /dev/null -chmod +x init.sh &> /dev/null -echo " " -echo " " -echo " " -exit 1 diff --git a/maintainer.sh b/maintainer.sh new file mode 100755 index 0000000..695f6e2 --- /dev/null +++ b/maintainer.sh @@ -0,0 +1,49 @@ +if [ ! "$BASH_VERSION" ] ; then + bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 + exit 1 +fi + +wiBold=$(tput bold) +wiNormal=$(tput sgr0) + +echo "" +echo "" +echo "" +echo "==============================" +echo -n "$wiBold" +echo " Warén Group " +echo -n "$wiNormal" +echo " Init " +echo "==============================" +echo " >> Maintainer << " +echo "------------------------------" + +case $1 in + build) + 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 + chmod +x init.sh &> /dev/null + ;; + update) + echo "Updating..." + cp ../wx/src/functions/header.sh src/functions/header.sh + cp ../wx/src/functions/repeat.sh src/functions/repeat.sh + cp ../wx/src/commands/login.sh src/functions/login.sh + ;; + ready) + echo "Ready" + ;; + *) + echo "Initializing..." + sleep 3 + ./$0 update + sleep 3 + ./$0 build + sleep 3 + ./$0 ready + ;; + esac +echo " " +echo " " +echo " " +exit 1 diff --git a/update.sh b/update.sh deleted file mode 100755 index 83cda50..0000000 --- a/update.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -if [ ! "$BASH_VERSION" ] ; then - bash $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 - exit 1 -fi - -wiBold=$(tput bold) -wiNormal=$(tput sgr0) - -echo "" -echo "" -echo "" -echo "==============================" -echo -n "$wiBold" -echo " Warén Group " -echo -n "$wiNormal" -echo "==============================" -echo " >> Init << " -echo "------------------------------" -cp ../wx/src/functions/header.sh src/functions/header.sh -cp ../wx/src/functions/repeat.sh src/functions/repeat.sh -cp ../wx/src/commands/login.sh src/functions/login.sh -echo " " -echo " " -echo " " -exit 1