Quellcode durchsuchen

Tweak env build test scripts

Scott Lahteine vor 5 Jahren
Ursprung
Commit
d05b23941d
3 geänderte Dateien mit 15 neuen und 45 gelöschten Zeilen
  1. 4
    14
      buildroot/bin/env_backup
  2. 6
    22
      buildroot/bin/env_clean
  3. 5
    9
      buildroot/bin/env_restore

+ 4
- 14
buildroot/bin/env_backup Datei anzeigen

@@ -1,24 +1,14 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-if [ ! -z "$1" ]; then
4
-    cd $1
5
-fi
3
+[ -z "$1" ] || cd $1
6 4
 
7 5
 if [ -d ".test" ]; then
8 6
   printf "\033[0;31mEnvironment backup already exists!\033[0m\n"
9 7
 else
10 8
   mkdir .test
11
-  cp Marlin/Configuration.h .test/Configuration.h
12
-  cp Marlin/Configuration_adv.h .test/Configuration_adv.h
13
-
14
-  if [ -f Marlin/_Bootscreen.h ]; then
15
-    cp Marlin/_Bootscreen.h .test/_Bootscreen.h
16
-  fi
17
-
18
-  if [ -f Marlin/_Statusscreen.h ]; then
19
-    cp Marlin/_Statusscreen.h .test/_Statusscreen.h
20
-  fi
21
-
9
+  cp Marlin/Configuration*.h .test/
10
+  [ -f Marlin/_Bootscreen.h ] && cp Marlin/_Bootscreen.h .test/
11
+  [ -f Marlin/_Statusscreen.h ] && cp Marlin/_Statusscreen.h .test/
22 12
   cp -r Marlin/src/pins .test/pins
23 13
   printf "\033[0;32mEnvironment Backup created\033[0m\n"
24 14
 fi

+ 6
- 22
buildroot/bin/env_clean Datei anzeigen

@@ -1,29 +1,13 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-if [ -d ".pioenvs" ]; then
4
-  rm -r .pioenvs
5
-fi
6
-
7
-if [ -d ".piolibdeps" ]; then
8
-  rm -r .piolibdeps
9
-fi
10
-
11
-if [ -d ".piolib" ]; then
12
-  rm -r .piolib
13
-fi
3
+[ -d ".pioenvs" ] && rm -r .pioenvs
4
+[ -d ".piolibdeps" ] && rm -r .piolibdeps
5
+[ -d ".piolib" ] && rm -r .piolib
14 6
 
15 7
 if [ ! -z "$1" ]; then
16 8
   if [ $1 = "--deep" ]; then
17
-    if [ -d "~/.platformio/packages" ]; then
18
-      rm -r ~/.platformio/packages/*
19
-    fi
20
-
21
-    if [ -d "~/.platformio/platforms" ]; then
22
-      rm -r ~/.platformio/platforms/*
23
-    fi
24
-
25
-    if [ -d "~/.platformio/.cache" ]; then
26
-      rm -r ~/.platformio/.cache/*
27
-    fi
9
+    [ -d "~/.platformio/packages" ] && rm -r ~/.platformio/packages/*
10
+    [ -d "~/.platformio/platforms" ] && rm -r ~/.platformio/platforms/*
11
+    [ -d "~/.platformio/.cache" ] && rm -r ~/.platformio/.cache/*
28 12
   fi
29 13
 fi

+ 5
- 9
buildroot/bin/env_restore Datei anzeigen

@@ -1,22 +1,18 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-if [ ! -z "$1" ]; then
4
-    cd $1
5
-fi
3
+[ -z "$1" ] || cd $1
6 4
 
7 5
 if [ -d ".test" ]; then
8
-  cp .test/Configuration.h Marlin/Configuration.h
9
-  cp .test/Configuration_adv.h Marlin/Configuration_adv.h
10
-  rm .test/Configuration.h
11
-  rm .test/Configuration_adv.h
6
+  cp .test/Configuration*.h Marlin/
7
+  rm .test/Configuration*.h
12 8
 
13 9
   if [ -f .test/_Bootscreen.h ]; then
14
-    cp .test/_Bootscreen.h Marlin/_Bootscreen.h
10
+    cp .test/_Bootscreen.h Marlin/
15 11
     rm .test/_Bootscreen.h
16 12
   fi
17 13
 
18 14
   if [ -f .test/_Statusscreen.h ]; then
19
-    cp .test/_Statusscreen.h Marlin/_Statusscreen.h
15
+    cp .test/_Statusscreen.h Marlin/
20 16
     rm .test/_Statusscreen.h
21 17
   fi
22 18
 

Laden…
Abbrechen
Speichern