When building a sketch that's not in a git directory, don't die.

We only cared because we were trying to get a nice version number
That doesn't matter as much as being able to build at all

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/591/head
Jesse Vincent 6 years ago
parent e2423fa793
commit 38b4663f00

@ -20,9 +20,9 @@ set -e
######
build_version () {
GIT_VERSION="$(cd "$(find_sketch)"; git describe --abbrev=4 --dirty --always)"
GIT_VERSION="$(cd "$(find_sketch)"; if [ -d .git ]; then echo '-g' && git describe --abbrev=4 --dirty --always; fi)"
LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}"
LIB_VERSION="$(cd "$(find_sketch)"; (grep version= "${LIB_PROPERTIES_PATH}/library.properties" 2>/dev/null || echo version=0.0.0) | cut -d= -f2)-g${GIT_VERSION}"
LIB_VERSION="$(cd "$(find_sketch)"; (grep version= "${LIB_PROPERTIES_PATH}/library.properties" 2>/dev/null || echo version=0.0.0) | cut -d= -f2)${GIT_VERSION}"
BUILD_PATH="${BUILD_PATH:-"$(mktemp -d 2>/dev/null || mktemp -d -t 'build')"}"
OUTPUT_DIR="${OUTPUT_DIR:-output/${LIBRARY}}"

Loading…
Cancel
Save