Skip to content

Commit bafbbfc

Browse files
committed
[build-script] Add an option --expand-build-script-invocation.
This option dumps the expanded build-script invocation for a preset without running the preset. Useful for debugging build-script preset invocations.
1 parent 8811870 commit bafbbfc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

utils/build-script

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,11 @@ def main_preset():
834834
help="'name=value' pairs that are substituted in the preset",
835835
nargs="*",
836836
metavar="SUBSTITUTION")
837+
parser.add_argument(
838+
"--expand-build-script-invocation",
839+
help="Print the expanded build-script invocation generated "
840+
"by the preset, but do not run the preset",
841+
action=arguments.action.optional_bool)
837842
args = parser.parse_args()
838843

839844
if len(args.preset_file_names) == 0:
@@ -872,8 +877,10 @@ def main_preset():
872877
"using preset '" + args.preset + "', which expands to \n\n" +
873878
shell.quote_command(build_script_args) + "\n")
874879

875-
call_without_sleeping(build_script_args)
880+
if args.expand_build_script_invocation:
881+
return 0
876882

883+
call_without_sleeping(build_script_args)
877884
return 0
878885

879886

0 commit comments

Comments
 (0)