Mercurial > hg > beaglert
comparison scripts/update_board @ 484:afbc8f973bb3 prerelease
update_board can skip updating the IDE
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Tue, 21 Jun 2016 15:16:55 +0100 |
parents | 5934790c7c15 |
children | 89212ad6a0bf |
comparison
equal
deleted
inserted
replaced
483:dbc76783db2a | 484:afbc8f973bb3 |
---|---|
36 Command line options: | 36 Command line options: |
37 -i arg : allows to set the username and IP address of the remote end (default: $BBB_ADDRESS) | 37 -i arg : allows to set the username and IP address of the remote end (default: $BBB_ADDRESS) |
38 -b arg : allows to set the path to the Bela folder on the remote end. Use quotes if you use the \"~\" symbol (default: $BBB_BELA_HOME) | 38 -b arg : allows to set the path to the Bela folder on the remote end. Use quotes if you use the \"~\" symbol (default: $BBB_BELA_HOME) |
39 --clean : removes all the files in the $BBB_BELA_HOME folder, INCLUDING any source code you may have in the $BBB_BELA_HOME/projects/ subdirectory. | 39 --clean : removes all the files in the $BBB_BELA_HOME folder, INCLUDING any source code you may have in the $BBB_BELA_HOME/projects/ subdirectory. |
40 -d : skips re-generating Doxygen documentation on the board. | 40 -d : skips re-generating Doxygen documentation on the board. |
41 -n : do not try to update the IDE. | |
41 --no-frills : skips some optional commands. | 42 --no-frills : skips some optional commands. |
42 -y : does not prompt the user before deleting the remote files. | 43 -y : does not prompt the user before deleting the remote files. |
43 " | 44 " |
44 } | 45 } |
45 | 46 |
58 FULL=1 | 59 FULL=1 |
59 OPTIND=1 | 60 OPTIND=1 |
60 ALWAYS_YES=0 | 61 ALWAYS_YES=0 |
61 RESET_BOARD=0 | 62 RESET_BOARD=0 |
62 DOXYGEN=1 | 63 DOXYGEN=1 |
64 UPDATE_IDE=1 | |
63 while [ "$1" != "" ]; do | 65 while [ "$1" != "" ]; do |
64 case $1 in | 66 case $1 in |
65 -b) | 67 -b) |
66 shift | 68 shift |
67 BBB_BELA_HOME=$1 | 69 BBB_BELA_HOME=$1 |
73 --clean) | 75 --clean) |
74 RESET_BOARD=1 | 76 RESET_BOARD=1 |
75 ;; | 77 ;; |
76 -d) | 78 -d) |
77 DOXYGEN=0 | 79 DOXYGEN=0 |
80 ;; | |
81 -n) | |
82 UPDATE_IDE=0 | |
78 ;; | 83 ;; |
79 --no-frills) | 84 --no-frills) |
80 FULL=0 | 85 FULL=0 |
81 ;; | 86 ;; |
82 -y) | 87 -y) |
174 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory coreclean &>/dev/null" | 179 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory coreclean &>/dev/null" |
175 error_handler $? "\nError cleaning core\n" | 180 error_handler $? "\nError cleaning core\n" |
176 | 181 |
177 #------------- | 182 #------------- |
178 #Installing IDE | 183 #Installing IDE |
179 [ $ALWAYS_YES -eq 0 ] && ALWAYS_YES_FLAG= || ALWAYS_YES_FLAG="-y" | 184 |
180 [ $FULL -eq 1 ] && NO_FRILLS_FLAG= || NO_FRILLS_FLAG="--no-frills" | 185 if [ $UPDATE_IDE -eq 1 ] |
181 ls $IDE_FOLDER/scripts/update_IDE >/dev/null 2>/dev/null | 186 then |
182 if [ $? -eq 0 ] | 187 [ $ALWAYS_YES -eq 0 ] && ALWAYS_YES_FLAG= || ALWAYS_YES_FLAG="-y" |
183 then | 188 [ $FULL -eq 1 ] && NO_FRILLS_FLAG= || NO_FRILLS_FLAG="--no-frills" |
184 export BBB_ADDRESS BBB_BELA_HOME | 189 ls $IDE_FOLDER/scripts/update_IDE >/dev/null 2>/dev/null |
185 cd $IDE_FOLDER/scripts && ./update_IDE $ALWAYS_YES_FLAG $NO_FRILLS_FLAG | 190 if [ $? -eq 0 ] |
186 # The IDE is restarted by the update_IDE script | 191 then |
192 export BBB_ADDRESS BBB_BELA_HOME | |
193 cd $IDE_FOLDER/scripts && ./update_IDE $ALWAYS_YES_FLAG $NO_FRILLS_FLAG | |
194 # The IDE is restarted by the update_IDE script | |
195 else | |
196 # run the IDE | |
197 printf "\nThe Bela core files were updated on the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated. | |
198 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide\n" | |
199 [ $FULL -eq 1 ] && printf "If there was an older version of the IDE on the board, it is being restarted.\n\n" &&\ | |
200 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" | |
201 fi | |
187 else | 202 else |
188 # run the IDE | 203 echo "Not updating the IDE" |
189 printf "\nThe Bela core files were updated on the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated. | 204 fi |
190 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide\n" | |
191 [ $FULL -eq 1 ] && printf "If there was an older version of the IDE on the board, it is being restarted.\n\n" &&\ | |
192 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" | |
193 fi | |
194 | |
195 [ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && printf "The board will now run the IDE at startup, but startup of the Bela program has been disabled.\nTo enable it, use the set_startup.sh script.\nTo control the ide use the ide.sh script\n" | 205 [ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && printf "The board will now run the IDE at startup, but startup of the Bela program has been disabled.\nTo enable it, use the set_startup.sh script.\nTo control the ide use the ide.sh script\n" |
196 | 206 |
197 [ $ALWAYS_YES -eq 1 ] && printf "\nSetup complete.\n\n" || { | 207 [ $ALWAYS_YES -eq 1 ] && printf "\nSetup complete.\n\n" || { |
198 printf '\nSetup complete, press any key to continue . . .\n\n' | 208 printf '\nSetup complete, press any key to continue . . .\n\n' |
199 read | 209 read |