Skip to content

Commit 6ae37b1

Browse files
authored
Merge pull request #993 from swagger-api/phpReadmeOptions
modify readme and sh file to allow full url
2 parents 386aa8e + f041b80 commit 6ae37b1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/main/resources/handlebars/php/README.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi
3131
"repositories": [
3232
{
3333
"type": "git",
34-
"url": "http://{{gitRepoBaseURL}}.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git"
34+
"url": "{{gitRepoBaseURL}}/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git"
3535
}
3636
],
3737
"require": {

src/main/resources/handlebars/php/git_push.sh.mustache

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_repo_base_url=$4
910

1011
if [ "$git_user_id" = "" ]; then
1112
git_user_id="{{{gitUserId}}}"
@@ -22,6 +23,11 @@ if [ "$release_note" = "" ]; then
2223
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
2324
fi
2425

26+
if [ "$git_repo_base_url" = "" ]; then
27+
git_repo_base_url="{{{gitRepoBaseURL}}}"
28+
echo "[INFO] No command line input provided. Set \$git_repo_base_url to $git_repo_base_url"
29+
fi
30+
2531
# Initialize the local directory as a Git repository
2632
git init
2733

@@ -37,16 +43,18 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git
48+
git_repo_base_url=${git_repo_base_url#*//}
49+
git_repo_base_url=${git_repo_base_url%%.*}
50+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}/${git_user_id}/${git_repo_id}.git
4351
fi
4452

4553
fi
4654

4755
git pull origin master
4856

4957
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git"
58+
echo "Git pushing to ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git"
5159
git push origin master 2>&1 | grep -v 'To https'
5260

0 commit comments

Comments
 (0)