How to write content to local disk for starlark

180 views Asked by At

I want to know how to dump something (say, some string) to local disk. I found there's actions.write API , but seems it only creates an action, but not executes it.

I'm wondering how I could execute an action in starlark?

1

There are 1 answers

0
Tinyden On

Bazel supports dumping parameters into a parameter file. Doc reference: https://bazel.build/rules/lib/builtins/Args#use_param_file

Example code:

args.use_param_file("@%s", use_always = False)
args.set_param_file_format("multiline")