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.
# Run setup.sh in each project.
if [ "$#" -eq "0" ]; then
# 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.
# 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'"
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
done
# Create git repository if necessary and/or additional remotes and fetch them.
elif [ "$#" -ge "2" ]; then