-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforeplay
52 lines (49 loc) · 1.28 KB
/
foreplay
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
### TODO: make sure this file can only be sourced
source ~/.config/bash-sex/functions
function sex
{
function load_sex_plugins
{
for plugin in ~/.config/bash-sex/plugins/*.sex; do
if [ "$1" = "ASK" ]; then
confirm "load $plugin" && \
source "$plugin"
else
echo " > Loading $plugin"
source "$plugin"
fi
done
}
echo "This is bash-sex: the Source EXtra plugin system for modular bash configuration"
case "$1" in
--ask-once)
echo "Found bash-sex plugins:"
\ls ~/.config/bash-sex/plugins/
echo
confirm "Load all plugins?" && load_sex_plugins
;;
--ask-each)
load_sex_plugins ASK
;;
--yes)
load_sex_plugins
;;
--undo)
#TODO! (Better be quick!)
;;
--help)
echo 'Well, if you need help... I recommend looking at the sex_cd I have bundled!'
confirm "View sex_cd?" && view ~/.config/bash-sex/plugins/local-history.sex
;;
*)
cat << EOMSG
Huh? What do you have in mind?
Usage:
sex --yes - load all plugins
--ask-once - list plugins and ask before loading all of them
--ask-each - itearate through all plugins and ask before loading each
--help - get some more tips
EOMSG
esac
}