* Determines the command line arguments for the current Bazel action. Since this action can * have a large set of input files, Bazel may write the arguments into a parameter file. * This function is responsible for handling normal argument passing or Bazel parameter files. * Read more here: https
()
| 13 | * Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file |
| 14 | */ |
| 15 | function getBazelActionArguments() { |
| 16 | const args = process.argv.slice(2); |
| 17 | |
| 18 | // If Bazel uses a parameter file, we've specified that it passes the file in the following |
| 19 | // format: "arg0 arg1 --param-file={path_to_param_file}" |
| 20 | if (args[0].startsWith('--param-file=')) { |
| 21 | return readFileSync(args[0].split('=')[1], 'utf8').trim().split('\n'); |
| 22 | } |
| 23 | |
| 24 | return args; |
| 25 | } |
| 26 | |
| 27 | if (require.main === module) { |
| 28 | const [ |