MIAOU-BASH is a collection of settings and helpers for leveraging BASH. Developer-friendly, it may be used as solo package with or without the miaou project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
955 B

8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
  1. #!/bin/bash
  2. set -Eeuo pipefail
  3. if [[ $(stat -c %u /opt/miaou-bash) -eq 0 ]]; then
  4. if [[ -d /opt/miaou-bash ]]; then
  5. local_release=$(cat /opt/miaou-bash/.semver_git_tag)
  6. fi
  7. echo -n "miaou-bash: collecting latest release from server url ... "
  8. remote_release=$(wget_semver artcode miaou/miaou-bash)
  9. echo -n "$remote_release"
  10. if [[ $local_release != $remote_release ]]; then
  11. echo " , upgrading from <$local_release> to <$remote_release> ..."
  12. curl --no-progress-meter https://git.artcode.re/miaou/miaou-bash/raw/branch/main/install.sh | sudo bash -s
  13. else
  14. echo " up-to-date!"
  15. fi
  16. else
  17. echo DEVELOPMENT MODE detected!
  18. if [[ $(stat -c %u /opt/miaou-bash) -eq $(id -u) ]]; then
  19. cd /opt/miaou-bash
  20. git pull
  21. cd -
  22. echo "git refreshed"
  23. else
  24. echo "please, ask user <$(stat -c %U /opt/miaou-bash)> to perform a git refresh!"
  25. exit 1
  26. fi
  27. fi