-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-linux.sh
executable file
·83 lines (78 loc) · 1.38 KB
/
setup-linux.sh
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
#!/bin/bash
# Robert A. Baykov <[email protected]>
DIRS_TO_LINK=(
.i3
.vim
.nanorc
.vimrc
.xinitrc
.Xresources
.Xresources.d
.zpreztorc
.zshrc
.walls
.wally
)
function usage()
{
# echo usage of script.
exit 0
}
function check_dependencies()
{
pass=true
for d in "${DEPENDENCIES[@]}"; do
hash "$d" &>/dev/null
if [ $? != 0 ]; then
echo "[ ! ] $d required"
pass=false
fi
done
if [ $pass == false ]; then
echo '[ ! ] unmet dependencies, aborting. '
exit -1
fi
}
function check_dirs()
{
# check the directories we have listed here
# exist in the repo
for d in "${DIRS_TO_LINK[@]}"; do
echo 'ayy' $d
file "$d" &>/dev/null
if [ $? != 0 ]; then
echo "[ ! ] $d required"
fi
done
}
function make_symlinks()
{
echo ""
# ln -s .i3 ~/.
# ln -s .vim ~/.
# ln -s .nanorc ~/.
# ln -s .vimrc ~/.
# ln -s .xinitrc ~/.
# ln -s .Xresources ~/.
# ln -s .zpreztorc ~/.
# ln -s .zshrc ~/.
# ln -s .walls ~/.
}
# function argparse()
# {
# while getopts "h?" opt; do
# case "$opt" in
# h|\?) usage "$@" ;;
# esac
# done
# }
function main()
{
#check_dirs
#get the user relative path of the repo
#check that home dir does not contain dirs
# if there are conflicts we prompt the user y/n to overwrite everything.
#cd to home dir and ln -s to relative path
#check ln -s's succeded (optional)
}
main "$@"