Created
April 29, 2019 22:07
-
-
Save haggen/24ff1927e66e7c2841c7c8c380dab255 to your computer and use it in GitHub Desktop.
ESO add-on releaser
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
#!/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