all.bash: use locally installed version of prettier

Switching all.bash to use a locally installed version
of prettier to remove the expectation that it is
globally installed.

Change-Id: Ib3bf0da16b3d8bfad817be693fff62776f6e99da
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/313529
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Jamal Carvalho 2021-04-26 11:38:46 -04:00
Родитель e88261ff22
Коммит d69db84c53
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -201,10 +201,10 @@ run_prettier() {
if [[ $files = '' ]]; then
files=$prettier_file_globs
fi
if [[ -x "$(command -v prettier)" ]]; then
runcmd prettier --write $files
if [[ -x "$(command -v npx)" ]]; then
runcmd npx prettier --write $files
else
err "prettier must be installed: see https://prettier.io/docs/en/install.html"
runcmd ./devtools/docker_nodejs.sh npx prettier --write $files
fi
}