~hedy/dotfiles

dotfiles/dotscripts/install/misc -rwxr-xr-x 2.2 KiB
29d99131 — hedy Fish: Fix prompt for fish v3.4.1 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env bash

if ! command -v diff-so-fancy &> /dev/null; then
    echo "installing diff-so-fancy"
    git clone https://github.com/so-fancy/diff-so-fancy ~/local/src/diffsofancy
    chmod +x ~/local/src/diffsofancy/diff-so-fancy
    ln -s ~/local/src/diffsofancy/diff-so-fancy ~/local/bin/
else
    echo "upgrading diff-so-fancy"
    cd ~/local/src/diffsofancy
    git pull
    chmod +x ~/local/src/diffsofancy/diff-so-fancy
    ln -f -s ~/local/src/diffsofancy/diff-so-fancy ~/local/bin/
    cd - > /dev/null
fi

if ! command -v vim &> /dev/null; then
    echo "warning: vim not found"
    echo "please install from your package manager and try again"
else
    if ! test -e ~/.vim/bundle/Vundle.vim; then
        echo "installing vundle"
        git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
        echo "installing vim plugins"
        vim +PluginInstall +qall
    else
        echo "upgrading vim plugins"
        vim +PluginUpdate +qall
        echo "upgrading vundle"
        cd ~/.vim/bundle/Vundle.vim
        git pull
        cd - > /dev/null
    fi
fi

if ! command -v tmux &> /dev/null; then
    echo "warning: tmux not found"
    echo "https://github.com/tmux/tmux/wiki"
else
    if ! test -e ~/.tmux/plugins/tpm; then
        echo "installing tmux package manager"
        git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
        tmux source ~/.tmux.conf
        echo "remember to hit <prefix> + I to install tmux plugins"
    else
        echo "upgrading tpm"
        cd ~/.tmux/plugins/tpm
        # git fetch origin
        # FIXME: don't hard code master and origin
        # reslog=$(git log HEAD..origin/master --oneline)
        # if [[ "${reslog}" != "" ]] ; then
        #     git merge origin/master # completing the pull
        #     tmux source ~/.tmux.conf
        #     cd - > /dev/null
        # fi
        git pull
        tmux source ~/.tmux.conf
        cd - > /dev/null
    fi
fi

if ! command -v tig &> /dev/null; then
    echo "installing tig"
    mkdir -p ~/local/src ~/local/bin
    prevpwd=$PWD
    cd ~/local/src
    git clone https://github.com/jonas/tig
    cd tig
    make prefix=~/local
    make install prefix=~/local
    cd $prevpwd
fi
# TODO: Also upgrade tig
echo "done!"