Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

support file label #8

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"