Skip to content

Instantly share code, notes, and snippets.

@selckin
Created April 26, 2018 14:29
Show Gist options
  • Save selckin/8bcdb8d09cda3e5ee89e61bb8fa457d0 to your computer and use it in GitHub Desktop.
Save selckin/8bcdb8d09cda3e5ee89e61bb8fa457d0 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ ! -d .git ]]; then
echo "cwd not a git repo"
exit 1
fi
if [[ ! -f pom.xml ]]; then
echo "cwd has no pom.xml"
exit 1
fi
target="$(mktemp -d --suffix=prstn)"
echo "${target}"
git archive --format=tar HEAD | tar -C "${target}" -xf -
cd "${target}"
mvn "${@}"
cd -
echo "Done"
read foobar
# rm -rf "${target}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment