-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.profile
More file actions
84 lines (72 loc) · 1.87 KB
/
init.profile
File metadata and controls
84 lines (72 loc) · 1.87 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
oh_my_profiles_dir=$HOME/.oh-my-profiles
profile=$oh_my_profiles_dir/var/profile
confdir=$HOME/.config/oh-my-profiles
function oh_my_profiles_imports {
if [ -d $confdir ]
then
for f in $confdir/*.profile;
do
source $f
done
fi
for f in $oh_my_profiles_dir/profiles/*.profile;
do
source $f
done
if [ -e $profile ]
then
source $profile
fi
}
function oh_my_profiles_update {
install_dir=$oh_my_profiles_dir
dir=`pwd`
cd $install_dir
cv=`git rev-parse --short HEAD`
b=`git rev-parse --abbrev-ref HEAD`
ov=`git rev-parse --short origin/$b`
if [ "$cv" != "$ov" ]
then
echo "[Oh My Profile:$cv/$ov] Would you like to update? [Y/n]: \c"
read line
if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
git pull
for f in $install_dir/zsh-theme/*
do
ln -s $f $HOME/.oh-my-zsh/themes/
done
fi
fi
install_dir=$HOME/.emacs.d
if [ -d "$install_dir/.git" ]
then
cd $install_dir
cv=`git rev-parse --short HEAD`
b=`git rev-parse --abbrev-ref HEAD`
ov=`git rev-parse --short origin/$b`
if [ "$cv" != "$ov" ]
then
echo "[Emacs] Would you like to update? [Y/n]: \c"
read line
if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
git pull
fi
fi
fi
cd $dir
}
function oh_my_profiles_setup_devel {
if [[ "$devel" == "" ]]
then
export devel=$HOME/data/devel
mkdir -p $devel
fi
}
function oh_my_profiles_init {
mkdir -p $oh_my_profiles_dir/var
oh_my_profiles_update
oh_my_profiles_setup_devel
oh_my_profiles_imports
fpath=($oh_my_profiles_dir/zsh-completions $fpath)
}
oh_my_profiles_init