From f04bb93e982060ed27e5cf6e4a8d97edeb0910b6 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 9 Jan 2025 23:17:37 +0100 Subject: extract the upwards find code into the util module --- tools/find-root | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 tools/find-root (limited to 'tools/find-root') diff --git a/tools/find-root b/tools/find-root deleted file mode 100755 index d2c71ab..0000000 --- a/tools/find-root +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -set -eu - -if [ ! "${1:-}" ]; then - exit 1 -fi - -BASEDIR="$(dirname "$1")" - -while read -r glob; do - cd "$BASEDIR" - - while [ "$PWD" != "/" ]; do - set -- $glob - - if [ -e "$1" ]; then - echo "$PWD" - exit 0 - fi - - cd .. - done -done - -echo "$BASEDIR" -- cgit v1.2.3