pgit.sh: Make PGIT_SH_PROJECTS work on all commands

PGIT_SH_PROJECTS currently only sets the projects to operate on for
the get command. Extend this to all commands. And replace the
environment variable by a command-line option, likely after this
script has been ported to Python.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-02-21 12:04:26 +01:00
commit 472bba6fbb

View file

@ -60,7 +60,11 @@ set_global_variables()
}
[ "$project_dirs" ] || {
if [ "$PGIT_SH_PROJECTS" ]; then
project_dirs="$PGIT_SH_PROJECTS"
else
project_dirs=`(cd $projects_dir; ls -d */.git 2>/dev/null | sed 's%/.git%%')`
fi
}
n_projects=`echo $project_dirs | wc -w`
}