瀏覽代碼

Tweak mf helper scripts

Scott Lahteine 3 年之前
父節點
當前提交
155dea6f14
共有 2 個檔案被更改,包括 11 行新增8 行删除
  1. 8
    6
      buildroot/bin/mftest
  2. 3
    2
      buildroot/share/git/mfqp

+ 8
- 6
buildroot/bin/mftest 查看文件

@@ -28,6 +28,7 @@ OPTIONS
28 28
   -a --autobuild   PIO Build using the MOTHERBOARD environment.
29 29
   -u --autoupload  PIO Upload using the MOTHERBOARD environment.
30 30
   -v --verbose     Extra output for debugging.
31
+  -s --silent      Silence build output from PlatformIO.
31 32
 
32 33
 env shortcuts: tree due esp lin lpc|lpc8 lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41
33 34
 "
@@ -62,6 +63,7 @@ while getopts 'abhmruvyn:t:-:' OFLAG; do
62 63
        esac
63 64
        ;;
64 65
     r) REBUILD=1         ; bugout "Rebuilding previous..." ;;
66
+    s) SILENT_FLAG="-s" ;;
65 67
     t) TESTENV="$OPTARG" ; bugout "Got a target: $TESTENV" ;;
66 68
     u) AUTO_BUILD=2      ; bugout "Auto-Upload target..." ;;
67 69
     v) DEBUG=1           ; bugout "Debug ON" ;;
@@ -105,8 +107,8 @@ if ((REBUILD)); then
105 107
   # Build with the last-built env
106 108
   [[ -f "$STATE_FILE" ]] || { errout "No previous (-r) build state found." ; exit 1 ; }
107 109
   read TESTENV <"$STATE_FILE"
108
-  pio run -s -d . -e $TESTENV
109
-  exit
110
+  pio run $SILENT_FLAG -d . -e $TESTENV
111
+  exit 0
110 112
 fi
111 113
 
112 114
 case $TESTENV in
@@ -189,12 +191,12 @@ if ((AUTO_BUILD)); then
189 191
 
190 192
   if ((AUTO_BUILD == 2)); then
191 193
     echo "Uploading environment $TARGET for board $MB ($BNUM)..." ; echo
192
-    pio run -t upload -e $TARGET
194
+    pio run $SILENT_FLAG -t upload -e $TARGET
193 195
   else
194 196
     echo "Building environment $TARGET for board $MB ($BNUM)..." ; echo
195
-    pio run -s -e $TARGET
197
+    pio run $SILENT_FLAG -e $TARGET
196 198
   fi
197
-  exit
199
+  exit 0
198 200
 fi
199 201
 
200 202
 #
@@ -306,6 +308,6 @@ fi
306 308
 
307 309
 [[ $BUILD_YES == 'Y' || $BUILD_YES == 'Yes' ]] && {
308 310
   ((USE_MAKE)) && make tests-single-local TEST_TARGET=$TESTENV ONLY_TEST=$CHOICE
309
-  ((USE_MAKE)) || pio run -s -d . -e $TESTENV
311
+  ((USE_MAKE)) || pio run $SILENT_FLAG -d . -e $TESTENV
310 312
   echo "$TESTENV" >"$STATE_FILE"
311 313
 }

+ 3
- 2
buildroot/share/git/mfqp 查看文件

@@ -4,7 +4,7 @@
4 4
 #
5 5
 #  - git add .
6 6
 #  - git commit --amend
7
-#  - ghpc
7
+#  - git push -f
8 8
 #
9 9
 
10 10
 MFINFO=$(mfinfo "$@") || exit 1
@@ -17,6 +17,7 @@ IND=6
17 17
 while [ $IND -lt ${#INFO[@]} ]; do
18 18
   ARG=${INFO[$IND]}
19 19
   case "$ARG" in
20
+    -f|--force ) FORCE=1 ;;
20 21
      -h|--help ) USAGE=1 ;;
21 22
              * ) USAGE=1 ; echo "unknown option: $ARG" ;;
22 23
   esac
@@ -25,6 +26,6 @@ done
25 26
 
26 27
 [[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; }
27 28
 
28
-[[ $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; }
29
+[[ $FORCE != 1 && $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; }
29 30
 
30 31
 git add . && git commit --amend && git push -f

Loading…
取消
儲存