File tree Expand file tree Collapse file tree 20 files changed +63
-64
lines changed
Expand file tree Collapse file tree 20 files changed +63
-64
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ ARCHIVE_NAME=$(basename "$(pwd)")
99
1010if [[ $BRANCH = tags* ]]; then
1111 BRANCH=$( git describe)
12- echo Building for tag \" $BRANCH \"
12+ echo Building for tag " \" $BRANCH \" "
1313 FILENAME=$ARCHIVE_NAME .$BRANCH .zip
1414else
15- echo Building archive on branch \" $BRANCH \"
15+ echo Building archive on branch " \" $BRANCH \" "
1616 # get a version string, so archives will not be overwritten when creating
1717 # many of them
1818 VERSION=$( git describe --always --long)
1919 # if not on master append branch name into the filename
20- if [ " $BRANCH " = $( git_extra_default_branch) ]; then
20+ if [ " $BRANCH " = " $( git_extra_default_branch) " ]; then
2121 FILENAME=$ARCHIVE_NAME .$VERSION .zip
2222 else
2323 FILENAME=$ARCHIVE_NAME .$VERSION .$BRANCH .zip
@@ -31,7 +31,7 @@ FILENAME=${FILENAME//\\/-}
3131OUTPUT=$( pwd) /$FILENAME
3232
3333# building archive
34- git archive --format zip --output " $OUTPUT " $BRANCH
34+ git archive --format zip --output " $OUTPUT " " $BRANCH "
3535
3636# also display size of the resulting file
3737echo Saved to \" " $FILENAME " \" \( " $( du -h " $OUTPUT " | cut -f1) " \)
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ if [[ $remote == "" ]]; then
1818fi
1919
2020# get remote url
21- remote_url=$( git remote get-url $remote )
21+ remote_url=$( git remote get-url " $remote " )
2222
2323if [[ $? -ne 0 ]]; then
2424 exit $?
Original file line number Diff line number Diff line change 99 remote=$1
1010fi
1111
12- if [[ $remote == " " ]]
12+ if [[ -z $remote ]]
1313then
1414 echo " Remote not found"
1515 exit 1
Original file line number Diff line number Diff line change @@ -89,10 +89,10 @@ function checkGitCommand () {
8989
9090# check if workspace name is registered
9191function checkWSName () {
92- while read workspace; do
92+ while read -r workspace; do
9393 parseWsName " $workspace "
9494 if [[ $rwsname == " $wsname " ]]; then return ; fi
95- done <<< " $(echo " $( listall) " )"
95+ done <<< " $(listall)"
9696 # when here the ws name was not found
9797 usage && echo 1>&2 " error: unknown workspace name: $wsname " && exit 1
9898}
@@ -106,14 +106,14 @@ function parseWsName () {
106106
107107# detects the wsname of the current directory
108108function wsnameToCurrent () {
109- while read workspace; do
109+ while read -r workspace; do
110110 if [ -z " $workspace " ]; then continue ; fi
111111 parseWsName " $workspace "
112112 if echo " $PWD " | grep -o -q " $rwsdir " ; then wsname=" $rwsname " && return ; fi
113- done <<< " $(echo " $( listall) " )"
113+ done <<< " $(listall)"
114114 # when here then not in workspace dir
115115 echo 1>&2 " error: you are not in a workspace directory. your registered workspaces are:" && \
116- wslist=" $( echo " $( listall) " ) " && echo 1>&2 " ${wslist:- ' <no workspaces defined yet>' } " && exit 1
116+ wslist=" $( listall) " && echo 1>&2 " ${wslist:- ' <no workspaces defined yet>' } " && exit 1
117117}
118118
119119# helper to check number of arguments.
Original file line number Diff line number Diff line change @@ -44,20 +44,20 @@ test -z $BRANCH && echo "branch argument required." 1>&2 && exit 1
4444if [[ -n $REMOTE ]]
4545then
4646 stderr=$( git_extra_mktemp)
47- git ls-remote --exit-code $REMOTE 1> /dev/null 2> " $stderr "
47+ git ls-remote --exit-code " $REMOTE " 1> /dev/null 2> " $stderr "
4848 REMOTE_EXIT=$?
4949 REMOTE_ERROR=$( < " $stderr " )
5050 rm -f " $stderr "
5151 if [ $REMOTE_EXIT -eq 0 ]
5252 then
5353 if [[ -n $START_POINT ]]; then
54- git fetch $REMOTE
55- git checkout --track -b $BRANCH $START_POINT
56- git push $REMOTE HEAD:refs/heads/$BRANCH
54+ git fetch " $REMOTE "
55+ git checkout --track -b " $BRANCH " " $START_POINT "
56+ git push " $REMOTE " " HEAD:refs/heads/$BRANCH "
5757 else
58- git push $REMOTE HEAD:refs/heads/$BRANCH
59- git fetch $REMOTE
60- git checkout --track -b $BRANCH $REMOTE /$BRANCH
58+ git push " $REMOTE " " HEAD:refs/heads/$BRANCH "
59+ git fetch " $REMOTE "
60+ git checkout --track -b " $BRANCH " " $REMOTE /$BRANCH "
6161 fi
6262 exit $?
6363 else
7070
7171if [[ -n $START_POINT ]]
7272then
73- git checkout -b $BRANCH " $START_POINT "
73+ git checkout -b " $BRANCH " " $START_POINT "
7474else
75- git checkout -b $BRANCH
75+ git checkout -b " $BRANCH "
7676fi
Original file line number Diff line number Diff line change 22set -e
33
44# Assert there is at least one branch provided
5- test -z $1 && echo " branch required." 1>&2 && exit 1
5+ test -z " $1 " && echo " branch required." 1>&2 && exit 1
66
77for branch in " $@ "
88do
9- remote=$( git config branch.$branch .remote || echo " origin" )
10- ref=$( git config branch.$branch .merge || echo " refs/heads/$branch " )
9+ remote=$( git config " branch.$branch .remote" || echo " origin" )
10+ ref=$( git config " branch.$branch .merge" || echo " refs/heads/$branch " )
1111
12- git branch -D $branch || true
12+ git branch -D " $branch " || true
1313 # Avoid deleting local upstream
14- [ " $remote " == " ." ] && continue
15- git branch -d -r $remote /$branch || continue
16- git push $remote :$ref
14+ [ " $remote " = " ." ] && continue
15+ git branch -d -r " $remote /$branch " || continue
16+ git push " $remote " " :$ref "
1717done
Original file line number Diff line number Diff line change 1212git for-each-ref refs/heads/ " --format=%(refname:short)" | while read -r branch; do
1313 mergeBase=$( git merge-base " $targetBranch " " $branch " )
1414
15- if [[ $( git cherry $targetBranch $( git commit-tree $( git rev-parse $branch \^ {tree}) -p $mergeBase -m _) ) == " -" * ]]; then
15+ if [[ $( git cherry " $targetBranch " $( git commit-tree $( git rev-parse $branch \^ {tree}) -p $mergeBase -m _) ) == " -" * ]]; then
1616 git branch -D " $branch "
1717 fi
1818done
Original file line number Diff line number Diff line change 2222done
2323
2424# Delete all the tags
25- git tag -d $local_tags
26- git push $origin $origin_refs
25+ git tag -d " $local_tags "
26+ git push " $origin " " $origin_refs "
Original file line number Diff line number Diff line change 1212 fi
1313fi
1414
15- git diff --name-only --diff-filter=$filter $branch
15+ git diff --name-only --diff-filter=" $filter " " $branch "
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ echo 'setting up gh-pages'
44echo ' -------------------'
55
66echo ' Tell me your github account username: '
7- read username
7+ read -r username
88
99echo ' Now, tell me your repository name: '
10- read repository
10+ read -r repository
1111
1212git stash \
1313&& git checkout -b ' gh-pages' \
You can’t perform that action at this time.
0 commit comments