From 155dea6f14d18f6b0f272cb2718ba4c28f3afe1d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 23 Mar 2021 23:58:53 -0500 Subject: [PATCH] Tweak mf helper scripts --- buildroot/bin/mftest | 14 ++++++++------ buildroot/share/git/mfqp | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index 4cecf4f3a..906e2abf8 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -28,6 +28,7 @@ OPTIONS -a --autobuild PIO Build using the MOTHERBOARD environment. -u --autoupload PIO Upload using the MOTHERBOARD environment. -v --verbose Extra output for debugging. + -s --silent Silence build output from PlatformIO. env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 " @@ -62,6 +63,7 @@ while getopts 'abhmruvyn:t:-:' OFLAG; do esac ;; r) REBUILD=1 ; bugout "Rebuilding previous..." ;; + s) SILENT_FLAG="-s" ;; t) TESTENV="$OPTARG" ; bugout "Got a target: $TESTENV" ;; u) AUTO_BUILD=2 ; bugout "Auto-Upload target..." ;; v) DEBUG=1 ; bugout "Debug ON" ;; @@ -105,8 +107,8 @@ if ((REBUILD)); then # Build with the last-built env [[ -f "$STATE_FILE" ]] || { errout "No previous (-r) build state found." ; exit 1 ; } read TESTENV <"$STATE_FILE" - pio run -s -d . -e $TESTENV - exit + pio run $SILENT_FLAG -d . -e $TESTENV + exit 0 fi case $TESTENV in @@ -189,12 +191,12 @@ if ((AUTO_BUILD)); then if ((AUTO_BUILD == 2)); then echo "Uploading environment $TARGET for board $MB ($BNUM)..." ; echo - pio run -t upload -e $TARGET + pio run $SILENT_FLAG -t upload -e $TARGET else echo "Building environment $TARGET for board $MB ($BNUM)..." ; echo - pio run -s -e $TARGET + pio run $SILENT_FLAG -e $TARGET fi - exit + exit 0 fi # @@ -306,6 +308,6 @@ fi [[ $BUILD_YES == 'Y' || $BUILD_YES == 'Yes' ]] && { ((USE_MAKE)) && make tests-single-local TEST_TARGET=$TESTENV ONLY_TEST=$CHOICE - ((USE_MAKE)) || pio run -s -d . -e $TESTENV + ((USE_MAKE)) || pio run $SILENT_FLAG -d . -e $TESTENV echo "$TESTENV" >"$STATE_FILE" } diff --git a/buildroot/share/git/mfqp b/buildroot/share/git/mfqp index 5650d0825..f0c4446a2 100755 --- a/buildroot/share/git/mfqp +++ b/buildroot/share/git/mfqp @@ -4,7 +4,7 @@ # # - git add . # - git commit --amend -# - ghpc +# - git push -f # MFINFO=$(mfinfo "$@") || exit 1 @@ -17,6 +17,7 @@ IND=6 while [ $IND -lt ${#INFO[@]} ]; do ARG=${INFO[$IND]} case "$ARG" in + -f|--force ) FORCE=1 ;; -h|--help ) USAGE=1 ;; * ) USAGE=1 ; echo "unknown option: $ARG" ;; esac @@ -25,6 +26,6 @@ done [[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; } -[[ $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; } +[[ $FORCE != 1 && $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; } git add . && git commit --amend && git push -f