changeset 461:26b3b87437fb prerelease

update_board made path-independent (for what is possible ... )
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 20 Jun 2016 13:49:48 +0100
parents f96238bdbb18
children d9a4fc5357e7
files scripts/update_board
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/update_board	Mon Jun 20 03:27:16 2016 +0100
+++ b/scripts/update_board	Mon Jun 20 13:49:48 2016 +0100
@@ -3,10 +3,13 @@
 # This script copies the core Bela files to the BeagleBone Black
 # in preparation for building projects. It will remove any existing
 # Bela directory before copying the files over
-[ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="/root/Bela/"
 
-. ./.bela_common || exit 1  
+# Find location of this script so we can locate the rest of the files
+SCRIPTDIR=$(dirname "$0")
+[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ 
+. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; }  
+
+[ -z "$IDE_FOLDER" ] && IDE_FOLDER=$SCRIPTDIR/../../bela-ide/
 
 FILES_TO_COPY="core include Makefile libNE10.a libprussdrv.a examples Doxyfile"
 
@@ -88,9 +91,6 @@
 done
 
 
-# Find location of this script so we can locate the rest of the files
-SCRIPTDIR=$(dirname "$0")
-[ -z "$IDE_FOLDER" ] && IDE_FOLDER=$SCRIPTDIR/../../bela-ide/
 
 # Check if destination folder exists
 # the StrictHostKeyChecking no should prevent the unkown host prompt
@@ -146,7 +146,7 @@
 if [ $RSYNC_AVAILABLE -eq 1 ];
 then
   [ -z `which sed` ] && FILTER=cat || FILTER="sed s/\\n// | sed s/^.*:/Updated\ files:\/g | tr \"\n\" \" \""
-  rsync -ac --no-t --delete-after --stats $FILES_TO_COPY $BBB_ADDRESS:$BBB_BELA_HOME |grep -i "Number" | grep -i "files" | grep -i "transferred" | eval $FILTER &&\
+  rsync -ac --no-t --delete-after --stats $FILES_TO_COPY $BBB_ADDRESS:$BBB_BELA_HOME 2>/dev/null |grep -i "Number" | grep -i "files" | grep -i "transferred" | eval $FILTER &&\
   rsync -ac --no-t libpd.so $BBB_ADDRESS:/usr/lib
 else
   # if rsync is not available, then clean the folders before copying the files
@@ -190,13 +190,13 @@
   [ $FULL -eq 1 ] && ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
 else
   # run the IDE 
-  [ $FULL -eq 1 ] && ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart"
-  [ $FULL -eq 1 ] && echo "The 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. If there was an older version of the IDE on the board, it is being restarted.
-You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide
-"
+   echo "The 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.
+You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide"
+  [ $FULL -eq 1 ] && ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" &&\
+  echo "If there was an older version of the IDE on the board, it is being restarted."
 fi
 
-[ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && echo "The board will now run the IDE at startup, but startup of the Bela program has been disabled. To enable it, use the set_startup.sh script" 
+[ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && echo "The board will now run the IDE at startup, but startup of the Bela program has been disabled. To enable it, use the set_startup.sh script. To control the ide use the ide.sh script" 
 
 [ $ALWAYS_YES -eq 1 ] && printf "\nSetup complete.\n\n" || {
   printf '\nSetup complete, press any key to continue\n\n'