|
@ -2,17 +2,31 @@ |
|
|
|
|
|
|
|
|
set -Eeuo pipefail |
|
|
set -Eeuo pipefail |
|
|
|
|
|
|
|
|
if [[ -d /opt/miaou-bash ]]; then |
|
|
|
|
|
|
|
|
if [[ $(stat -c %u /opt/miaou-bash) -eq 0 ]]; then |
|
|
|
|
|
|
|
|
|
|
|
if [[ -d /opt/miaou-bash ]]; then |
|
|
local_release=$(cat /opt/miaou-bash/.semver_git_tag) |
|
|
local_release=$(cat /opt/miaou-bash/.semver_git_tag) |
|
|
fi |
|
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
echo -n "miaou-bash: collecting latest release from server url ... " |
|
|
|
|
|
remote_release=$(wget_semver artcode miaou/miaou-bash) |
|
|
|
|
|
echo -n "$remote_release" |
|
|
|
|
|
|
|
|
echo -n "miaou-bash: collecting latest release from server url ... " |
|
|
|
|
|
remote_release=$(wget_semver artcode miaou/miaou-bash) |
|
|
|
|
|
echo -n "$remote_release" |
|
|
|
|
|
|
|
|
if [[ $local_release != $remote_release ]]; then |
|
|
|
|
|
|
|
|
if [[ $local_release != $remote_release ]]; then |
|
|
echo " , upgrading from <$local_release> to <$remote_release> ..." |
|
|
echo " , upgrading from <$local_release> to <$remote_release> ..." |
|
|
curl --no-progress-meter https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh | sudo bash -s |
|
|
curl --no-progress-meter https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh | sudo bash -s |
|
|
else |
|
|
|
|
|
|
|
|
else |
|
|
echo " up-to-date!" |
|
|
echo " up-to-date!" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
echo DEVELOPMENT MODE detected! |
|
|
|
|
|
if [[ $(stat -c %u /opt/miaou-bash) -eq $(id -u) ]]; then |
|
|
|
|
|
cd /opt/miaou-bash |
|
|
|
|
|
git pull |
|
|
|
|
|
cd - |
|
|
|
|
|
echo "git refreshed" |
|
|
|
|
|
else |
|
|
|
|
|
echo "please, ask user <$(stat -c %U /opt/miaou-bash)> to perform a git refresh!" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
fi |
|
|
fi |