chaosflix/.circleci/getVersionCode.sh

10 lines
259 B
Bash
Raw Normal View History

2019-05-04 21:52:03 +00:00
#!/bin/sh
COUNT=$(git rev-list --count HEAD | tr -d '\n\r')
COUNT=$(expr $COUNT - 800)
2019-05-04 21:52:03 +00:00
if [ $(expr $COUNT % 2) -ne 0 ]; then
COUNT=$(expr $COUNT - 1)
fi
case $1 in
--touch|-t|touch) printf $COUNT ;;
--leanback|-l|leanback) printf $(expr $COUNT - 1) ;;
esac