Skip to content

Commit

Permalink
Allow to choose between http:// and https:// for Redmine URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffroy-aubry committed Sep 16, 2012
1 parent 9043867 commit 851f8a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conf/twgit-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TWGIT_MAX_RETRIEVE_TAGS_NOT_MERGED=3
TWGIT_FEATURE_SUBJECT_CONNECTOR='' # in {'', 'github', 'redmine'}
TWGIT_FEATURE_SUBJECT_CONNECTOR_PATH="$TWGIT_INC_DIR/connectors/feature_subject_%s.sh" # où %s est un $TWGIT_FEATURE_SUBJECT_CONNECTOR
TWGIT_FEATURE_SUBJECT_REDMINE_API_KEY='' # API key is a 40-byte hexadecimal string.
TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN='' # e.g. 'www.redmine.org'
TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN='' # e.g. 'www.redmine.org', with optionally scheme: 'http://', 'https://' (default).
TWGIT_FEATURE_SUBJECT_GITHUB_USER='' # e.g. 'Twenga'
TWGIT_FEATURE_SUBJECT_GITHUB_REPOSITORY='' # e.g. 'twgit'

Expand Down
9 changes: 7 additions & 2 deletions inc/connectors/feature_subject_redmine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@
# @param string $1 issue number or project name
#
ref="$1"
issue_url="https://$TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN/issues/$ref.json?key=$TWGIT_FEATURE_SUBJECT_REDMINE_API_KEY"
project_url="https://$TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN/projects/$ref.json?key=$TWGIT_FEATURE_SUBJECT_REDMINE_API_KEY"
if [[ "$TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN" =~ ^https?:// ]]; then
scheme=''
else
scheme='https://'
fi
issue_url="$scheme$TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN/issues/$ref.json?key=$TWGIT_FEATURE_SUBJECT_REDMINE_API_KEY"
project_url="$scheme$TWGIT_FEATURE_SUBJECT_REDMINE_DOMAIN/projects/$ref.json?key=$TWGIT_FEATURE_SUBJECT_REDMINE_API_KEY"

if [[ "$ref" =~ ^[0-9]+$ ]]; then
(wget --no-check-certificate --timeout=2 -q -O - --no-cache $issue_url \
Expand Down

0 comments on commit 851f8a5

Please sign in to comment.