Easily download any file from a public GitHub Gist account, with a one single command.
Because of reasons I do not have a dotfile
repository. I prefer to store my .vimrc
, .gitconfig
, .bash_whatever
etc. as Gists.
Thus, to be honest, I wrote this script so I can update my .vimrc
with one single command.
$ pip install getgist
GetGist runs with Python 2 or 3 and is built only with core modules (no dependencies but Python).
Just run getgist <user> <file>
. For example:
user@localhost ~ $ getgist cuducos .vimrc
Fetching https://api.github.com/users/cuducos/gists …
Fetching https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/f8acc26f0422b02fc282c5b4e97b70710044dbb3/.vimrc …
Replace existing .vimrc ? (y/n) y
Deleting existing .vimrc …
Saving new .vimrc …
Done!
user@localhost ~ $
If you decide not to delete your copy of the local file, it will be renamed with extensions such as .bkp
, .bkp.1
, .bkp.2
etc.
Feel free to report an issue, open a pull request, or drop a line.
- Authenticate users to:
- Have a default user (
$ getgist .vimrc
to mine,$ getgist johndoe .vimrc
to get John's one) - Allow the possibility of getting private Gists
- Have a default user (
- Write tests for
Gist.__backup()
So far I consider this script just public domain.