Skip to content

Commit

Permalink
Merge pull request MeltwaterArchive#40 from invodo/feature/fix-featur…
Browse files Browse the repository at this point in the history
…e-sed

Fix sed cross-platform compatibility issues
  • Loading branch information
stuartherbert committed Mar 23, 2013
2 parents 7fa6c92 + 8bcc573 commit fd9332c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion git-hf-feature
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ EOS
fi

# parse Pull Request URL from response
PR_URL=$( echo $resp | sed -rn 's|.+"html_url":\s*"([^"]++/pull/[^"]+)".+|\1|p;' )
PR_URL=$(echo $resp |
awk -F"," '{for(i=1;i<=NF;i++){if($i~/html_url/){print $i"\n"}}}' |
grep 'pull' |
awk -F"\":" '{print $2}' |
awk -F"\"" '{print $2}')

if [ -z "$PR_URL" ]; then
die "Failed to create Pull Request"
fi
Expand Down
9 changes: 5 additions & 4 deletions hubflow-common
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,11 @@ github_auth_token() {
fi

GITHUB_TOKEN=$(curl -s \
-u "$USER:$PASS" \
-d '{"scopes":["repo"],"note":"gitflow automation"}' \
"$GITHUB_API_URL/authorizations" |
sed -rn 's/.+"token":\s*"(.+)".+/\1/p')
-u "$USER:$PASS" \
-d '{"scopes":["repo"],"note":"gitflow automation"}' \
"$GITHUB_API_URL/authorizations" |
awk -F"," '{for(i=1;i<=NF;i++){if($i~/token/){print $i}}}' |
awk -F":" '{print $2}'| awk -F"\"" '{print $2}')

git config "$GITHUB_AUTH_TOKEN_KEY" "$GITHUB_TOKEN"
fi
Expand Down

0 comments on commit fd9332c

Please sign in to comment.