Skip to content

Commit

Permalink
build: re-introduce 'args' attr to tilt rule
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Nov 1, 2023
1 parent 8ccd15a commit 190ec61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dev/tilt.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ tilt = rule(
default = "Tiltfile",
doc = """The Tiltfile to run.""",
),
"args": attrs.list(
attrs.string(),
default = [],
doc = """Additional arguments passed as <Tiltfile args>.""",
),
},
)

Expand All @@ -25,14 +30,16 @@ set -euo pipefail
rootpath="$(git rev-parse --show-toplevel)"
subcmd="$1"
tiltfile="$2"
args=("${@:3}")
tilt "$subcmd" --file "$rootpath"/"$tiltfile"
tilt "$subcmd" --file "$rootpath"/"$tiltfile" -- "${args[@]}"
""", is_executable = True)

run_cmd_args = cmd_args([
script,
subcmd,
tiltfile,
ctx.attrs.args
])

args_file = ctx.actions.write("tilt-args.txt", run_cmd_args)
Expand Down

0 comments on commit 190ec61

Please sign in to comment.