Skip to content

Commit 9b8068f

Browse files
committed
fix: Passing arguments to basalt run now work
1 parent e4af81d commit 9b8068f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/lib/commands/do-run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ do-run() {
55

66
local -a args=()
77
for arg; do case "$arg" in
8+
--)
9+
shift
10+
break
11+
;;
812
-*)
913
bprint.die "Flag '$arg' not recognized"
1014
;;
1115
*)
1216
args+=("$arg")
17+
shift
1318
;;
1419
esac done
1520

@@ -28,7 +33,7 @@ do-run() {
2833
for bin_file in "$bin_dir"/*; do
2934
if [ -f "$bin_file" ] && [ -x "$bin_file" ]; then
3035
util.deinit
31-
exec "$bin_file"
36+
exec "$bin_file" "$@"
3237
elif [ -f "$bin_file" ]; then
3338
bprint.die "File '$bin_name' is found, but the package providing it has not made it executable"
3439
else
@@ -42,7 +47,7 @@ do-run() {
4247
local bin_file="$BASALT_LOCAL_PROJECT_DIR/.basalt/bin/$bin_name"
4348
if [ -f "$bin_file" ] && [ -x "$bin_file" ]; then
4449
util.deinit
45-
exec "$bin_file"
50+
exec "$bin_file" "$@"
4651
elif [ -f "$bin_file" ]; then
4752
bprint.die "File '$bin_name' is found, but the package providing it has not made it executable"
4853
else

0 commit comments

Comments
 (0)