File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,27 @@ do-run() {
21
21
bprint.die " The only argument must be the executable name"
22
22
fi
23
23
24
+ # Look in current package
24
25
local bin_name=" ${args[0]} "
26
+ if util.get_toml_array " $BASALT_LOCAL_PROJECT_DIR /basalt.toml" ' binDirs' ; then
27
+ for bin_dir in " ${REPLIES[@]} " ; do
28
+ for bin_file in " $bin_dir " /* ; do
29
+ if [ -f " $bin_file " ] && [ -x " $bin_file " ]; then
30
+ util.deinit
31
+ exec " $bin_file "
32
+ elif [ -f " $bin_file " ]; then
33
+ bprint.die " File '$bin_name ' is found, but the package providing it has not made it executable"
34
+ else
35
+ bprint.die " No executable called '$bin_name ' was found"
36
+ fi
37
+ done ; unset bin_file
38
+ done ; unset bin_dir
39
+ fi
40
+
41
+ # Look in subdependencies
25
42
local bin_file=" $BASALT_LOCAL_PROJECT_DIR /.basalt/bin/$bin_name "
26
- if [ -x " $bin_file " ]; then
43
+ if [ -f " $bin_file " ] && [ -x " $bin_file " ]; then
44
+ util.deinit
27
45
exec " $bin_file "
28
46
elif [ -f " $bin_file " ]; then
29
47
bprint.die " File '$bin_name ' is found, but the package providing it has not made it executable"
Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ util.init_always() {
69
69
else
70
70
___basalt_lock_dir=" $BASALT_GLOBAL_DATA_DIR /basalt.lock"
71
71
fi
72
- if mkdir " $___basalt_lock_dir " ; then
73
- trap ' rm -rf "$___basalt_lock_dir" ' INT TERM EXIT
72
+ if mkdir " $___basalt_lock_dir " 2> /dev/null ; then
73
+ trap ' util.deinit ' INT TERM EXIT
74
74
else
75
75
bprint.die " Cannot run Basalt at this time because another Basalt process is already running (lock directory '$___basalt_lock_dir ' exists)"
76
76
fi
@@ -81,6 +81,10 @@ util.init_always() {
81
81
fi
82
82
}
83
83
84
+ util.deinit () {
85
+ rm -rf " $___basalt_lock_dir "
86
+ }
87
+
84
88
# @description Ensure the downloaded file is really a .tar.gz file...
85
89
util.file_is_targz () {
86
90
local file=" $1 "
You can’t perform that action at this time.
0 commit comments