4 ms·
Instead of putting the password in as a plaintext argument, you can store it in the OS X keychain and access it with the command described here: http://www.macl
by masnick 14y ago
Instead of putting the password in as a plaintext argument, you can store it in the OS X keychain and access it with the command described here: http://www.maclovin.de/2010/02/access-os-x-keychain-from-terminal/ http://www.maclovin.de/2010/02/access-os-x-keychain-from-ter...
I use this in my .zshrc to create Bitbucket repos on the fly:
function bitbucket() {
curl -X POST -u masnick:`security 2>&1 >/dev/null find-internet-password -gs masnick.bitbucket.org | cut -d '"' -f 2` https://api.bitbucket.org/1.0/repositories/ -d name=$@ -d scm=git -d is_private=True
};
(Running "bitbucket newrepo" will create a new repo in my Bitbucket acct called "newrepo".)