diff --git a/coderockr-way-github-setup.bash b/coderockr-way-github-setup.bash index 946e076..4732e28 100755 --- a/coderockr-way-github-setup.bash +++ b/coderockr-way-github-setup.bash @@ -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: @@ -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 @@ -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 @@ -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" @@ -141,4 +149,3 @@ while read -r label; do echo "Label \"$label_name\" created" fi done <<< "$LABELS" -