From 21736cf0a2ed7519b4e55be05c2d4a256a919da7 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 30 Sep 2023 17:17:58 -0600 Subject: [PATCH] Recycle wf_root output --- _reformat-common.bash | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_reformat-common.bash b/_reformat-common.bash index fd2e87d..3a16f33 100644 --- a/_reformat-common.bash +++ b/_reformat-common.bash @@ -41,6 +41,13 @@ function project_root() { # When run from a dir with would-format configured, return # would-format's own directory wf_root() { + set +u + if [[ ! -z "${WF_ROOT}" ]]; then + echo "$WF_ROOT" + return 0 + fi + set -u + arg=$(pwd)/bin/would-reformat.sh pr=$(project_root "$arg")