refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / iterm2 / install.sh
1 #!/bin/bash
2
3 set -e
4 set -u
5
6 function _install_iterm2() {
7     # only for macOS
8     if [[ "Darwin" != "$(uname -s)" ]]; then
9         echo ""
10         echo "iTerm2 is only for macOS"
11         echo ""
12         echo "You might want to check out:"
13         echo "    alacritty for Linux"
14         echo "    Windows Terminal for Windows, of course"
15         echo ""
16         exit 1
17     fi
18
19     webi_download
20     webi_extract
21
22     if [[ ! -d "${WEBI_TMP}/iTerm.app" ]]; then
23         echo "error unpacking iTerm2:"
24         ls -lAF "${WEBI_TMP}"
25         exit 1
26     fi
27
28     if [[ -d ~/Applications/iTerm.app ]]; then
29         mv ~/Applications/iTerm.app "${WEBI_TMP}/iTerm.app-webi.bak"
30     fi
31     mkdir -p ~/Applications/
32     mv "${WEBI_TMP}/iTerm.app" ~/Applications/
33 }
34
35 _install_iterm2