prettier: don't depend on system node being available
This commit is contained in:
parent
7143e8f3d0
commit
63404de5df
@ -1,4 +1,7 @@
|
|||||||
# this is a hack to invoke prettier directly from Bazel
|
# this is a hack to invoke prettier directly from Bazel
|
||||||
|
node=$(pwd)/$1
|
||||||
|
node_dir=$(dirname $node)
|
||||||
|
export PATH="$node_dir:$PATH"
|
||||||
(cd "${BUILD_WORKSPACE_DIRECTORY}" && node_modules/.bin/prettier \
|
(cd "${BUILD_WORKSPACE_DIRECTORY}" && node_modules/.bin/prettier \
|
||||||
--config .prettierrc --write \
|
--config .prettierrc --write \
|
||||||
$BUILD_WORKING_DIRECTORY )
|
$BUILD_WORKING_DIRECTORY )
|
||||||
|
@ -30,4 +30,6 @@ def prettier(name = "format", **kwargs):
|
|||||||
native.sh_binary(
|
native.sh_binary(
|
||||||
name = name,
|
name = name,
|
||||||
srcs = ["format.sh"],
|
srcs = ["format.sh"],
|
||||||
|
args = ["$(location @nodejs//:node_bin)"],
|
||||||
|
data = ["@nodejs//:node_bin"],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user