From 0763e4ecaf053a5c621afd04e1238be549c441f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=E1=BA=A3i?= Date: Fri, 15 Mar 2024 13:53:19 +0700 Subject: [PATCH] Stop falling back to WASM sane-fmt WASM sane-fmt doesn't exist here --- run-on-save | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run-on-save b/run-on-save index 65698aae..e98fa3a9 100755 --- a/run-on-save +++ b/run-on-save @@ -27,16 +27,16 @@ set -o errexit -o pipefail -o nounset # TASK: Use sane-fmt to format TypeScript/JavaScript file -# Recommend: Install native sane-fmt for good performance (https://github.com/sane-fmt/sane-fmt) +# for ext in js ts jsx tsx; do if [[ "$FILE" == *.$ext && "$FILE" != *node_modules* ]]; then if which sane-fmt &>/dev/null; then echo "Run sane-fmt on $FILE" sane-fmt --color=never --write "$FILE" else - echo 'Using WebAssembly implementation of sane-fmt' - echo 'Recommend: Install native version from https://github.com/sane-fmt/sane-fmt' - pnpm run sane-fmt:fix -- --color=never --hide-passed + echo 'Fail to detect sane-fmt in PATH' + echo 'See for installation instruction' + exit 1 fi break fi