From 9833cd32b3689ec7f482eb72a77653416331907b Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Sun, 23 Jul 2023 19:40:28 +0000 Subject: [PATCH] Revert "chore(scripts): support sappling in project_root" This reverts commit 685573508586eaf59c7d8f3aa88c2332c9f80007. This was pushed accidentally. --- scripts/lib.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index bf83eeebd4..f5cf7a97c0 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -41,17 +41,7 @@ realpath() { # We have to define realpath before these otherwise it fails on Mac's bash. SCRIPT="${BASH_SOURCE[1]:-${BASH_SOURCE[0]}}" SCRIPT_DIR="$(realpath "$(dirname "$SCRIPT")")" - -function project_root { - dir=$(pwd) - - while [[ "$dir" != "" && ! -e "$dir/.git" && ! -e "$dir/.sl" ]]; do - dir=${dir%/*} - done - - echo "$dir" -} -PROJECT_ROOT="$(cd "$SCRIPT_DIR" && realpath "$(project_root)")" +PROJECT_ROOT="$(cd "$SCRIPT_DIR" && realpath "$(git rev-parse --show-toplevel)")" # pushd is a silent alternative to the real pushd shell command. pushd() {