1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-12-21 21:49:40 -08:00
rc/sh/pegg

20 lines
755 B
Bash
Executable file

#!/usr/bin/env sh
# compat: +ash +bash +dash -hush +zsh
pegg() { ### @-
### download and (pip) install a Python "egg" from a project on GitHub,
### defaulting to the master branch. this uses [`pippy`](#pippy) internally.
###
### ```sh
### # install the development version of https://github.com/rthalley/dnspython
### $ pegg rthalley dnspython
### # or instead install the latest stable version (as of writing)
### $ pegg rthalley dnspython 3933b49
### ```
[ $# -ge 2 ] || { printf "%s\n" "$0: too few arguments" >&2; return 1; }
pippy "https://github.com/$1/$2/tarball/${3:-master}#egg=$2"
}
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
eval ${preload:-preload} pippy
[ -n "${preload+-}" ] || pegg "$@"