Skip to content

Commit

Permalink
support file label
Browse files Browse the repository at this point in the history
  • Loading branch information
avelino committed Dec 24, 2018
1 parent 8ce524b commit 4a0bc8d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions coderockr-way-github-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function getHelp {
--help, -h Show this help
--user, -u GitHub username
--password, -p GitHub password
--file, -f Set label file
--verbose, -v Details process
Usage:
Expand Down Expand Up @@ -38,9 +39,12 @@ do
elif [[ $i == '--user' ]] || [[ $i == '-u' ]]; then
GITHUB_USERNAME=${args[$counter + 1]}
readed_counter=$[$readed_counter + 1]
elif [[ $i == '--password' ]] || [[ $i == '-p' ]]; then
elif [[ $i == '--password' ]] || [[ $i == '-p' ]]; then
GITHUB_PASSWORD=${args[$counter + 1]}
readed_counter=$[$readed_counter + 1]
elif [[ $i == '--file' ]] || [[ $i == '-f' ]]; then
LABEL_FILE=${args[$counter + 1]}
readed_counter=$[$readed_counter + 1]
elif [[ $i == '--verbose' ]] || [[ $i == '-v' ]]; then
VERBOSE=1
else
Expand Down Expand Up @@ -79,7 +83,10 @@ invalid
question
wontfix'

LABELS='Category: Backend,c2e0c6
if [ -f $LABEL_FILE ]; then
LABELS="$(cat ${LABEL_FILE})"
else
LABELS='Category: Backend,c2e0c6
Category: Business/Meetings,0e8a16
Category: DevOps,fef2c0
Category: Frontend,bfdadc
Expand Down Expand Up @@ -108,6 +115,7 @@ Type: Bug,fc2929
Type: Improvement,84b6eb
Type: New feature,0052cc
Type: Sub-task,ededed'
fi

if [[ "$VERBOSE" == 1 ]]; then
echo "Removing default labels"
Expand Down Expand Up @@ -141,4 +149,3 @@ while read -r label; do
echo "Label \"$label_name\" created"
fi
done <<< "$LABELS"

0 comments on commit 4a0bc8d

Please sign in to comment.