Skip to content

Commit

Permalink
Add support to pass subset without arg specifier in Unix (dotnet#34844)
Browse files Browse the repository at this point in the history
* Add support to pass subset without arg specifier in Unix

* PR Feedback

* Fix regex expression to match whole word
  • Loading branch information
safern authored Apr 13, 2020
1 parent 1a0498d commit c1566cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,19 @@ source $scriptroot/native/init-os-and-arch.sh
# Check if an action is passed in
declare -a actions=("b" "build" "r" "restore" "rebuild" "testnobuild" "sign" "publish" "clean")
actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort)))
firstArgumentChecked=0

while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"

if [[ $firstArgumentChecked -eq 0 && $opt =~ ^[a-zA-Z.+]+$ ]]; then
arguments="$arguments /p:Subset=$1"
shift 1
continue
fi

firstArgumentChecked=1

case "$opt" in
-help|-h)
usage
Expand Down

0 comments on commit c1566cc

Please sign in to comment.