From 226027116ef76509934153406e2f4770b56c26d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 27 Aug 2017 18:57:01 +0200 Subject: [PATCH] List available environments with build script --- code/build.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/code/build.sh b/code/build.sh index 9caf480c..3c051dc8 100755 --- a/code/build.sh +++ b/code/build.sh @@ -1,15 +1,28 @@ #!/bin/bash -# Environments to build +# Welcome +echo "--------------------------------------------------------------" +echo "ESPURNA FIRMWARE BUILDER" + +# Available environments +available=`cat platformio.ini | grep env: | grep -v ota | sed 's/\[env://' | sed 's/\]/ /' | sort` environments=$@ +if [ "$environments" == "list" ]; then + echo "--------------------------------------------------------------" + echo "Available environments:" + for environment in $available; do + echo "* $environment" + done + exit +fi + +# Environments to build if [ $# -eq 0 ]; then - environments=`cat platformio.ini | grep env: | grep -v ota | sed 's/\[env://' | sed 's/\]/ /'` + environments=$available fi # Get current version version=`cat espurna/config/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'` -echo "--------------------------------------------------------------" -echo "ESPURNA FIRMWARE BUILDER" echo "Building for version $version" # Create output folder