Skip to content

Instantly share code, notes, and snippets.

@JNRowe
Forked from sorin-ionescu/make-hubugs.sh
Created April 3, 2012 20:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JNRowe/2295152 to your computer and use it in GitHub Desktop.
Save JNRowe/2295152 to your computer and use it in GitHub Desktop.
Make a self contained hubugs
#!/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 -E "$environment" 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