Skip to content

Instantly share code, notes, and snippets.

@haggen
Created April 29, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haggen/24ff1927e66e7c2841c7c8c380dab255 to your computer and use it in GitHub Desktop.
Save haggen/24ff1927e66e7c2841c7c8c380dab255 to your computer and use it in GitHub Desktop.
ESO add-on releaser
#!/usr/bin/env sh
path="$(realpath "$1")"
test "$path" = "" && { echo "Usage: $0 <path>" >&2; exit 1; }
test -d "$path" || { echo "$path does not exist" >&2; exit 1; }
pushd "$path"
test -d .git || { echo "not a git repository" >&2; exit 1; }
name="$(basename "$path")"
version="$(grep -Po "# Version: \K.+" "$name.txt")"
git archive --format=zip -o "../$name-$version.zip" --prefix="$name/" HEAD .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment