/install.sh

https://github.com/schpet/dotfiles · Shell · 61 lines · 39 code · 15 blank · 7 comment · 2 complexity · 84907430f44a631ada5b75bf55ea63b5 MD5 · raw file

  1. #!/usr/bin/env bash
  2. set -e
  3. # TODO: following stuff is all linux, need to figure out mac
  4. case "$(uname -s)" in
  5. Darwin)
  6. echo 'todo: mac os x setup, install homebrew etc'
  7. ;;
  8. Linux)
  9. echo "installing linux deps!"
  10. sudo apt-get update
  11. export DEBIAN_FRONTEND=noninteractive
  12. sudo apt-get -y install --no-install-recommends bat stow jq
  13. # gh cli
  14. curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
  15. echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
  16. sudo apt update
  17. sudo apt install gh
  18. # ripgrep
  19. curl -sLO https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb
  20. sudo dpkg -i ripgrep_13.0.0_amd64.deb
  21. rm ripgrep_13.0.0_amd64.deb
  22. # heroku cli
  23. curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
  24. # starship
  25. curl -fsSL https://starship.rs/install.sh > starship.sh
  26. sh starship.sh -f
  27. rm starship.sh
  28. ;;
  29. CYGWIN*|MINGW32*|MSYS*|MINGW*)
  30. echo 'todo: windows'
  31. ;;
  32. *)
  33. echo "Unknown os: $(uname -s)"
  34. ;;
  35. esac
  36. # codespaces comes with a few defaults that i don't want to clobber blindly
  37. files_to_backup=(".gitconfig" ".zshrc")
  38. for file in ${files_to_backup[@]}; do
  39. original_path="$HOME/$file"
  40. if test -f $original_path; then
  41. new_destination="$HOME/$file.orig"
  42. echo "moving existing $original_path to $new_destination"
  43. mv "$original_path" "$new_destination"
  44. fi
  45. done
  46. stow . -t $HOME -v 2 --adopt