File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change 3
3
do-run () {
4
4
util.init_local
5
5
6
- local -a args=()
7
- for arg; do case " $arg " in
8
- --)
9
- shift
10
- break
11
- ;;
12
- -* )
13
- bprint.die " Flag '$arg ' not recognized"
14
- ;;
15
- * )
16
- args+=(" $arg " )
17
- shift
18
- ;;
19
- esac done
20
-
21
- if (( ${# args[@]} == 0 )) ; then
6
+ if (( $# == 0 )) ; then
22
7
bprint.die " The name of an executable must be passed"
23
8
fi
24
9
25
- if (( ${# args[@]} > 1 )) ; then
26
- bprint.die " The only argument must be the executable name"
27
- fi
10
+ local bin_name=" $0 "
11
+ shift
28
12
29
13
# Look in current package
30
- local bin_name=" ${args[0]} "
31
14
if util.get_toml_array " $BASALT_LOCAL_PROJECT_DIR /basalt.toml" ' binDirs' ; then
32
15
for bin_dir in " ${REPLIES[@]} " ; do
33
16
for bin_file in " $BASALT_LOCAL_PROJECT_DIR /$bin_dir " /* ; do
34
17
if [ -f " $bin_file " ] && [ -x " $bin_file " ]; then
35
18
util.deinit
19
+ bprint.info " Running $bin_file "
36
20
exec " $bin_file " " $@ "
37
21
elif [ -f " $bin_file " ]; then
38
22
bprint.die " File '$bin_name ' is found, but the package providing it has not made it executable"
@@ -47,6 +31,7 @@ do-run() {
47
31
local bin_file=" $BASALT_LOCAL_PROJECT_DIR /.basalt/bin/$bin_name "
48
32
if [ -f " $bin_file " ] && [ -x " $bin_file " ]; then
49
33
util.deinit
34
+ bprint.info " Running $bin_file "
50
35
exec " $bin_file " " $@ "
51
36
elif [ -f " $bin_file " ]; then
52
37
bprint.die " File '$bin_name ' is found, but the package providing it has not made it executable"
You can’t perform that action at this time.
0 commit comments