Skip to content

Instantly share code, notes, and snippets.

@arashkashi
Created June 19, 2016 22:03
Show Gist options
  • Save arashkashi/f9cbc545e8980c385e4e795b2aea12d7 to your computer and use it in GitHub Desktop.
Save arashkashi/f9cbc545e8980c385e4e795b2aea12d7 to your computer and use it in GitHub Desktop.
#!/bin/bash
HEAD_HASH=$(git rev-parse HEAD)
TAGS=$(git tag)
RESULT_FILE_NAME=""
for tag in $TAGS
do
TAG_COMMIT_HASH=$(git rev-list -n 1 $tag)
if [ "$TAG_COMMIT_HASH" = "$HEAD_HASH" ]; then
RESULT_FILE_NAME=arash${tag}.framework
fi
done
if [ "$RESULT_FILE_NAME" = "" ]; then
RESULT_FILE_NAME=arash===${HEAD_HASH}.framework
fi
echo $RESULT_FILE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment