-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot
executable file
·66 lines (56 loc) · 1.39 KB
/
dot
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
#!/bin/bash
function indent {
echo ":: $*"
}
export dir=$(readlink -f $(dirname $0))
function short_usage {
printf "%b" \
" usage: $0 [directive] [options]
DIRECTIVES
-h: Print short help message.
--help: Print longer help message.
add [files...]: Move the files to the dotfiles repository.
and create a link from the origional location.
install: Create links to each tracked file.
status | st: Show the status of the git repository.
"
}
function usage {
short_usage
printf "%b" "
INFORMATION
dot is a file syncing tool build around git, designed for
configuration files.
Tracked files are placed in the dotfiles repository, and
links to the files are created in the origional locations.
The dotfiles repository is where this script, and the tracked
dotfiles are found. Probabaly ~/dotfiles, or ~/.dotfiles.
TODO: seperate scripts from dotfiles repository, define .dotfilesrc
In the dotfiles repository is a file called 'locations', which
defines folders in the repository, and where there contents should
be linked.
"
}
prog=$1
shift
case $prog in
"-h")
short_usage
;;
"--help")
usage
;;
"add")
$dir/add $@
;;
"install")
$dir/install
;;
"status" | "st")
(cd $dir && git status -sb)
;;
*)
indent "$prog a not recognised directive"
short_usage
;;
esac