Select projects from positional arguments (closes #3)
This commit is contained in:
parent
2092f45303
commit
23ef11c2a3
16
git-build.sh
16
git-build.sh
|
@ -18,8 +18,22 @@ run() {
|
|||
# So scripts can know we're still running (for autoupdater)
|
||||
touch $BASEDIR/.LOCK
|
||||
|
||||
# Find targeted projects from args
|
||||
PROJECTS=()
|
||||
for arg in "$@"; do
|
||||
[ -f $BASEDIR/$arg.source ] && PROJECTS+=("$arg")
|
||||
# use elseif to match other arguments, so we can do else print arg not found
|
||||
done
|
||||
|
||||
# If no project argument passed, default to all projects
|
||||
if [[ ${#PROJECTS[*]} = 0 ]]; then
|
||||
for project in $BASEDIR/*.source; do
|
||||
p_name="$(basename $project .source)"
|
||||
# Extract the project name from path
|
||||
PROJECTS+=("$(basename $project .source)")
|
||||
done
|
||||
fi
|
||||
|
||||
for p_name in ${PROJECTS[*]}; do
|
||||
echo "[$p_name] START"
|
||||
[ -f $BASEDIR/$p_name.branch ] && p_branch="$(cat $BASEDIR/$p_name.branch)" || p_branch="master"
|
||||
p_dir="$BASEDIR/.$p_name"
|
||||
|
|
Loading…
Reference in New Issue