Skip to content

Commit 0d71a79

Browse files
committed
fix: Add 'program' at end of 'set' action
1 parent 2a4ef2b commit 0d71a79

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/lib/do.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ do_set() {
2020
# -------------------------- set ------------------------- #
2121
# Source category pre
2222
if [ -f "$dbDir/$category/set-pre.sh" ]; then
23-
source "$dbDir/$category/set-pre.sh"
23+
source "$dbDir/$category/set-pre.sh" "$dbDir/$category" "$program"
2424
fi
2525

2626
# Source program pre
2727
if [ -f "$dbDir/$category/$program/set-pre.sh" ]; then
28-
source "$dbDir/$category/$program/set-pre.sh"
28+
source "$dbDir/$category/$program/set-pre.sh" "$dbDir/$category" "$program"
2929
fi
3030

3131
# Actually set
3232
printf "%s" "$program" >| "$dbDir/$category/_.current"
3333

3434
# Source program post
3535
if [ -f "$dbDir/$category/$program/set-post.sh" ]; then
36-
source "$dbDir/$category/$program/set-post.sh"
36+
source "$dbDir/$category/$program/set-post.sh" "$dbDir/$category" "$program"
3737
fi
3838

3939
# Source category post
4040
if [ -f "$dbDir/$category/set-post.sh" ]; then
41-
source "$dbDir/$category/set-post.sh"
41+
source "$dbDir/$category/set-post.sh" "$dbDir/$category" "$program"
4242
fi
4343

4444
log.info "Category '$category' defaults to '$program'"
@@ -69,18 +69,18 @@ do_launch() {
6969
# ------------------------ launch ------------------------ #
7070
# Source category pre
7171
if [ -f "$dbDir/$category/launch-pre.sh" ]; then
72-
source "$dbDir/$category/launch-pre.sh"
72+
source "$dbDir/$category/launch-pre.sh" "$dbDir/$category" "$program"
7373
fi
7474

7575
# Source program pre
7676
if [ -f "$dbDir/$category/$program/launch-pre.sh" ]; then
77-
source "$dbDir/$category/$program/launch-pre.sh"
77+
source "$dbDir/$category/$program/launch-pre.sh" "$dbDir/$category" "$program"
7878
fi
7979

8080
# Source launch if it exists. If otherwise, infer
8181
# the launch command from the program name
8282
if [ -f "$dbDir/$category/$program/launch.sh" ]; then
83-
if ! source "$dbDir/$category/$program/launch.sh"; then
83+
if ! source "$dbDir/$category/$program/launch.sh" "$dbDir/$category" "$program"; then
8484
log.die "$gui" "Source failed"
8585
fi
8686
else
@@ -89,12 +89,12 @@ do_launch() {
8989

9090
# Source program post
9191
if [ -f "$dbDir/$category/$program/launch-post.sh" ]; then
92-
source "$dbDir/$category/$program/launch-post.sh"
92+
source "$dbDir/$category/$program/launch-post.sh" "$dbDir/$category" "$program"
9393
fi
9494

9595
# Source category post
9696
if [ -f "$dbDir/$category/launch-post.sh" ]; then
97-
source "$dbDir/$category/launch-post.sh"
97+
source "$dbDir/$category/launch-post.sh" "$dbDir/$category" "$program"
9898
fi
9999
}
100100

0 commit comments

Comments
 (0)