Skip to content

Instantly share code, notes, and snippets.

@mwhudson
Created March 21, 2017 21:25
Show Gist options
  • Save mwhudson/a3c9961da9470beb8bde3e3fb8272f73 to your computer and use it in GitHub Desktop.
Save mwhudson/a3c9961da9470beb8bde3e3fb8272f73 to your computer and use it in GitHub Desktop.
#!/bin/sh
DATE="$(TZ=UTC date +"%Y%m%d" -d "@$(git log -1 --pretty=format:%ct)")"
HASH="$(git log -n 1 "--format=format:%h")"
VERSION="0.0~git${DATE}.0.${HASH}"
PKG="$1"
ORIG="${PKG}_${VERSION}.orig.tar.gz"
git archive --prefix "${PKG}-${VERSION}/" -o ../$ORIG HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment