Files
vern-nvim/walkup.sh
T
DarthMooMancer 677e5bbc67 fix: fixed git initialization for project
chore: change write_file to take table instead of string
2025-05-11 14:19:49 -04:00

21 lines
461 B
Bash
Executable File

#!/usr/bin/env bash
# Start from the current directory
DIR="$(pwd)"
# Walk up until we find a marker or reach root
while [[ ! -f "$DIR/CMakeLists.txt" && \
! -f "$DIR/package.json" && \
! -d "$DIR/.git" && \
"$DIR" != "/" ]]; do
DIR="$(dirname "$DIR")"
done
# Check if root was reached without finding anything
if [[ "$DIR" == "/" ]]; then
echo "❌ Project root not found."
exit 1
fi
echo "✅ Project root found at: $DIR"