@@ -17,9 +17,30 @@ do_set() {
17
17
fi
18
18
program=" $REPLY "
19
19
20
+ # -------------------------- set ------------------------- #
21
+ # Source category pre
22
+ if [ -f " $dbDir /$category /set-pre.sh" ]; then
23
+ source " $dbDir /$category /set-pre.sh"
24
+ fi
25
+
26
+ # Source program pre
27
+ if [ -f " $dbDir /$category /$program /set-pre.sh" ]; then
28
+ source " $dbDir /$category /$program /set-pre.sh"
29
+ fi
30
+
20
31
# Actually set
21
32
printf " %s" " $program " > | " $dbDir /$category /_.current"
22
33
34
+ # Source program post
35
+ if [ -f " $dbDir /$category /$program /set-post.sh" ]; then
36
+ source " $dbDir /$category /$program /set-post.sh"
37
+ fi
38
+
39
+ # Source category post
40
+ if [ -f " $dbDir /$category /set-post.sh" ]; then
41
+ source " $dbDir /$category /set-post.sh"
42
+ fi
43
+
23
44
log.info " Category '$category ' defaults to '$program '"
24
45
}
25
46
@@ -47,13 +68,13 @@ do_launch() {
47
68
48
69
# ------------------------ launch ------------------------ #
49
70
# Source category pre
50
- if [ -f " $dbDir /$category /pre.sh" ]; then
51
- source " $dbDir /$category /pre.sh"
71
+ if [ -f " $dbDir /$category /launch- pre.sh" ]; then
72
+ source " $dbDir /$category /launch- pre.sh"
52
73
fi
53
74
54
75
# Source program pre
55
- if [ -f " $dbDir /$category /$program /pre.sh" ]; then
56
- source " $dbDir /$category /$program /pre.sh"
76
+ if [ -f " $dbDir /$category /$program /launch- pre.sh" ]; then
77
+ source " $dbDir /$category /$program /launch- pre.sh"
57
78
fi
58
79
59
80
# Source launch if it exists. If otherwise, infer
@@ -63,21 +84,17 @@ do_launch() {
63
84
log.die " $gui " " Source failed"
64
85
fi
65
86
else
66
- if ! command -v " $program " & > /dev/null; then
67
- log.die " $gui " " Executable '$program ' does not exist or is not in the current environment"
68
- fi
69
-
70
- exec " $program "
87
+ log.die " $gui " " launch.sh for program '$program ' does not exist"
71
88
fi
72
89
73
90
# Source program post
74
- if [ -f " $dbDir /$category /$program /post.sh" ]; then
75
- source " $dbDir /$category /$program /post.sh"
91
+ if [ -f " $dbDir /$category /$program /launch- post.sh" ]; then
92
+ source " $dbDir /$category /$program /launch- post.sh"
76
93
fi
77
94
78
95
# Source category post
79
- if [ -f " $dbDir /$category /post.sh" ]; then
80
- source " $dbDir /$category /post.sh"
96
+ if [ -f " $dbDir /$category /launch- post.sh" ]; then
97
+ source " $dbDir /$category /launch- post.sh"
81
98
fi
82
99
}
83
100
0 commit comments