Select projects from positional arguments (closes #3)
This commit is contained in:
parent
2092f45303
commit
23ef11c2a3
18
git-build.sh
18
git-build.sh
|
@ -18,8 +18,22 @@ run() {
|
||||||
# So scripts can know we're still running (for autoupdater)
|
# So scripts can know we're still running (for autoupdater)
|
||||||
touch $BASEDIR/.LOCK
|
touch $BASEDIR/.LOCK
|
||||||
|
|
||||||
for project in $BASEDIR/*.source; do
|
# Find targeted projects from args
|
||||||
p_name="$(basename $project .source)"
|
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
|
||||||
|
# Extract the project name from path
|
||||||
|
PROJECTS+=("$(basename $project .source)")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
for p_name in ${PROJECTS[*]}; do
|
||||||
echo "[$p_name] START"
|
echo "[$p_name] START"
|
||||||
[ -f $BASEDIR/$p_name.branch ] && p_branch="$(cat $BASEDIR/$p_name.branch)" || p_branch="master"
|
[ -f $BASEDIR/$p_name.branch ] && p_branch="$(cat $BASEDIR/$p_name.branch)" || p_branch="master"
|
||||||
p_dir="$BASEDIR/.$p_name"
|
p_dir="$BASEDIR/.$p_name"
|
||||||
|
|
Loading…
Reference in New Issue