From 1812dfba95f61a3d3cc77a8d2130636353767686 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 3 Jun 2009 16:12:11 +0200 Subject: [PATCH] setup.sh: Improve setup support. A better find rule is used and the correct project path is printed (instead of project/.git). If a setup.sh shouldn't be used just remove the executable bit. Also only existing setup.sh files are used. This prevents the "no such file or directory: setup.sh" warning. --- setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 74da7c1..6e5a69a 100755 --- a/setup.sh +++ b/setup.sh @@ -57,12 +57,14 @@ git_remote_init_update() { # Run setup.sh in each project. if [ "$#" -eq "0" ]; then - for project in `find . -name .git -type d`; do + for path in `find . -name setup.sh -type f -executable`; do # Skip this directory to prevent an infinite loop. - [ "$project" = "./.git" ] && continue + [ "$path" = "./setup.sh" ] && continue + + project=`echo "$path" | sed 's|/setup.sh$||'` echo "running setup.sh in '$project'" - ( cd "$project/.."; ./setup.sh > /dev/null ) + ( cd "$project"; ./setup.sh > /dev/null ) done # Create git repository if necessary and/or additional remotes and fetch them. elif [ "$#" -ge "2" ]; then -- 2.43.2