2018-05-04 01:44:29 +03:00
|
|
|
template("npm_action") {
|
|
|
|
assert(defined(invoker.script),
|
|
|
|
"Need script name to run (must be defined in package.json)")
|
2018-10-04 02:03:26 +03:00
|
|
|
assert(defined(invoker.args), "Need script argumets")
|
2018-05-04 01:44:29 +03:00
|
|
|
|
|
|
|
action(target_name) {
|
2018-10-04 02:03:26 +03:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"deps",
|
|
|
|
"public_deps",
|
|
|
|
"sources",
|
|
|
|
"inputs",
|
|
|
|
"outputs",
|
|
|
|
])
|
2018-05-04 01:44:29 +03:00
|
|
|
script = "//electron/build/npm-run.py"
|
|
|
|
args = [
|
2018-10-04 02:03:26 +03:00
|
|
|
"--silent",
|
|
|
|
invoker.script,
|
|
|
|
"--",
|
|
|
|
] + invoker.args
|
2018-05-04 01:44:29 +03:00
|
|
|
}
|
|
|
|
}
|