-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·52 lines (44 loc) · 1.38 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·52 lines (44 loc) · 1.38 KB
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
#!/bin/bash
# Change to own dir
cd "$(dirname "$0")" || exit 1
# Asked to configure the OS too?
if [[ "$1" == "--os" ]]; then
# Run script. (We are already in the right directory.)
./os-setup.sh
fi
# .bashrc is a special case, since it usually exists. If it's not ours,
# rename it to .bashrc.orig
printf "Installing .bashrc: "
if [[ -L ~/.bashrc ]]; then
printf "\033[00;32mOK:\033[00m No need to remove original .bashrc\n"
else
printf "\033[00;33mINFO:\033[00m Renaming .bashrc to .bashrc.orig\n"
mv ~/.bashrc ~/.bashrc.orig
fi
# Installs the softlinks in place.
mysoftlink() {
local file="$1"
local softlink="$2"
printf "Installing %s: " "$file"
if [[ -L "$softlink" ]]; then
printf "\033[00;32mOK:\033[00m Your %s is already a soft link, nice!\n" "$softlink"
else
if [[ -e "$softlink" ]]; then
printf "\033[00;31mWARNING: You have %s - please move it away.\033[00m\n" "$softlink"
else
ln -s ~/.kkrc/"$file" "$softlink"
printf "\033[00;32mOK:\033[00m Installed.\n"
fi
fi
}
# Process all files/dirs
. ./kkrc-files
# Update git submodules
echo "Updating git submodules:"
if [[ -e ~/.kkrc/.vim/pack/kkrc/start/vim-sensible/README.markdown ]]; then
git submodule update --remote --merge
else
git submodule update --init --depth 1
# XXX Not using --recursive for now, because we don't need vim plugins' test-subrepos and stuff.
#WAS: git submodule update --recursive --init
fi