Permalink
Browse files

upload-to-github: also guess user from ~/.netrc

... unless it is specified explicitly, of course...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
1 parent 2c2276f commit 1aecd3d48aa9e9a54106521c87c1cdc90b4ca010 @dscho dscho committed Apr 17, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/upload-to-github.sh
@@ -79,6 +79,10 @@ msysGit-fullinstall-*)
;;
esac
+test -z "$user" &&
+user="$(grep -A2 -i '^machine *api.github.com' < "$HOME/.netrc" 2> /dev/null |
+ sed -n 's|login *||pi')"
+
if test -z "$description" || test -z "$user" || test -z "$repository"
then
echo "$USAGE"

0 comments on commit 1aecd3d

Please sign in to comment.