Last active
October 2, 2015 02:38
-
-
Save sorin-ionescu/2154419 to your computer and use it in GitHub Desktop.
Make a self contained hubugs
This file contains 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
#!/bin/zsh | |
if (( ! $+commands[virtualenv] )); then | |
print "$0: no such command: virtualenv" >&2 | |
return 1 | |
fi | |
if (( ! $+commands[git] )); then | |
print "$0: no such command: git" >&2 | |
return 1 | |
fi | |
out='hubugs' | |
executable="$out/bin/hubugs" | |
environment="$out/libexec/hubugs" | |
if [[ -d "$out" ]]; then | |
print "$0: already exists: $out" >&2 | |
return 1 | |
fi | |
mkdir -p "$executable:h" | |
mkdir -p "$environment" | |
virtualenv "$environment" | |
path=("$environment/bin" $path) | |
pip install termcolor | |
pip install 'git+https://github.com/JNRowe/hubugs.git#egg=hubugs' | |
virtualenv --relocatable "$environment" | |
print '#!/bin/zsh | |
"${0:A:h:h}/libexec/hubugs/bin/hubugs" "$@"' > "$executable" | |
chmod u+x "$executable" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment