]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_core/commitdiff
host/pushcommon.sh for push scripts
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 11 Oct 2016 22:09:45 +0000 (18:09 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Tue, 11 Oct 2016 22:09:45 +0000 (18:09 -0400)
host/pushcommon.sh [new file with mode: 0644]
host/pushinit.sh

diff --git a/host/pushcommon.sh b/host/pushcommon.sh
new file mode 100644 (file)
index 0000000..730f70f
--- /dev/null
@@ -0,0 +1,11 @@
+if [ -z ${HOST:-} ]; then
+  # Uses LUATOOL to push init and dependencies to the device; bootstrap!
+  PUSHCMD="${LUATOOL} --delay 0.1 -p ${MCUPORT} -b ${MCUBAUD}"
+  dopush() { ${PUSHCMD} -f $1 -t ${2:-`basename $1`}; }
+  dopushcompile() { ${PUSHCMD} -f $1 -t ${2:-`basename $1`} -c; }
+else
+  # Uses host/pushvia to push everything if HOST is set
+  PUSHCMD="./host/pushvia.expect ${HOST} ${PORT:-23}"
+  dopush() { ${PUSHCMD} ${2:-`basename $1`} $1; }
+  dopushcompile() { ${PUSHCMD} ${2:-`basename $1`} $1 compile; }
+fi
index a48c051fc34c57dd9d3fb97cb9e8302ec0ac621b..504d587936ab0de7e7556fbd430710a93701ea24 100755 (executable)
@@ -1,17 +1,7 @@
 #!/bin/bash
 set -e -u
 
-if [ -z ${HOST:-} ]; then
-  # Uses LUATOOL to push init and dependencies to the device; bootstrap!
-  PUSHCMD="${LUATOOL} --delay 0.1 -p ${MCUPORT} -b ${MCUBAUD}"
-  dopush() { ${PUSHCMD} -f $1 -t ${2:-`basename $1`}; }
-  dopushcompile() { ${PUSHCMD} -f $1 -t ${2:-`basename $1`} -c; }
-else
-  # Uses host/pushvia to push everything if HOST is set
-  PUSHCMD="./host/pushvia.expect ${HOST} ${PORT:-23}"
-  dopush() { ${PUSHCMD} ${2:-`basename $1`} $1; }
-  dopushcompile() { ${PUSHCMD} ${2:-`basename $1`} $1 compile; }
-fi
+. ./host/pushcommon.sh
 
 dopushcompile util/diag.lua
 dopushcompile tq/tq.lua