Created
February 21, 2013 00:36
-
-
Save zackdever/5000987 to your computer and use it in GitHub Desktop.
when creating an arc paste (http://www.phabricator.com/docs/phabricator/article/Arcanist_User_Guide.html), automatically copy the address to the cilpboard on os x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias arcpaste='arc paste | copyarcpaste' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import sys | |
lines = sys.stdin.readlines() | |
sys.stdout.writelines(lines) | |
tail = lines[-1] | |
url = tail[tail.index('http'):] | |
os.system('echo "%s" | pbcopy' % url) | |
sys.stdout.write('Copied arc paste address to clipboard.\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment