Skip to content

Commit

Permalink
push: make clipboard copying work in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Sep 27, 2011
1 parent b692f10 commit 57b8d42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions push
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ if [[ "$remote_url" =~ "github.com" ]]; then

repo_name=$(echo $remote_url | sed 's/.*\:\(.*\)\.git/\1/')
github_url="https://github.com/$repo_name/compare/$refs"
which -s pbcopy && echo $github_url | pbcopy && echo "Compare URL copied to clipboard!"
copied="Compare URL copied to clipboard!"
which -s pbcopy >& /dev/null && echo $github_url | pbcopy && echo $copied
which xclip >& /dev/null && echo $github_url | xclip -selection clipboard && echo $copied
# which -s open && open -g $github_url

echo $github_url
echo
fi

exit 0
exit 0

0 comments on commit 57b8d42

Please sign in to comment.