2021-07-29 00:37:35 -07:00
|
|
|
#!/usr/bin/env sh
|
2024-07-23 00:04:57 -07:00
|
|
|
# compat: +ash +bash +dash -hush +zsh
|
2021-07-29 00:37:35 -07:00
|
|
|
|
2021-07-30 19:41:16 -07:00
|
|
|
pegg() { ### @-
|
2021-08-01 09:27:25 -07:00
|
|
|
### 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
|
|
|
|
### ```
|
2021-07-29 00:37:35 -07:00
|
|
|
[ $# -ge 2 ] || { printf "%s\n" "$0: too few arguments" >&2; return 1; }
|
|
|
|
pippy "https://github.com/$1/$2/tarball/${3:-master}#egg=$2"
|
|
|
|
}
|
|
|
|
|
2021-09-23 06:48:05 -07:00
|
|
|
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
|
|
|
|
eval ${preload:-preload} pippy
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || pegg "$@"
|