install.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. coded_by='
  3. In the name of Allah, the most Gracious, the most Merciful.
  4. ▓▓▓▓▓▓▓▓▓▓
  5. ░▓ Author ▓ Abdullah <https://abdullah.today>
  6. ░▓▓▓▓▓▓▓▓▓▓ YouTube <https://YouTube.com/AbdullahToday>
  7. ░░░░░░░░░░
  8. '
  9. # Install my configuration files for some programs I can't live without.
  10. if grep -qs "ubuntu" /etc/os-release; then
  11. os="ubuntu"
  12. elif [[ -e /etc/debian_version ]]; then
  13. os="debian"
  14. elif [[ -e /etc/centos-release ]]; then
  15. os="centos"
  16. elif [[ -e /etc/fedora-release ]]; then
  17. os="fedora"
  18. elif [[ -e /etc/arch-release ]]; then
  19. os="archlinux"
  20. elif [[ -e /etc/gentoo-release ]]; then
  21. os="gentoo"
  22. elif [[ "$osTYPE" == "darwin"* ]]; then
  23. os="macos"
  24. else
  25. echo "please install stow manually then try again."
  26. exit
  27. fi
  28. if ! command -v stow >/dev/null 2>&1; then
  29. if [[ "$os" = 'debian' ]]; then
  30. sudo apt-get install -y stow git
  31. elif [[ "$os" = 'ubuntu' ]]; then
  32. sudo apt-get install -y stow git
  33. elif [[ "$os" = 'macos' ]]; then
  34. brew install stow git
  35. elif [[ "$os" = 'centos' ]]; then
  36. sudo yum -y install stow git
  37. elif [[ "$os" = 'fedora' ]]; then
  38. sudo yum -y install stow git
  39. elif [[ "$os" = 'gentoo' ]]; then
  40. sudo emerge stow git
  41. elif [[ "$os" = 'archlinux' ]]; then
  42. sudo pacman -S --noconfirm stow git
  43. fi
  44. fi
  45. git clone https://gitlab.com/Abdullah/cfg.git ~/cfg
  46. cd ~/cfg || exit
  47. for d in */; do stow "${d%/}"; done
  48. echo 'Congrats, you are done, Enjoy!'