aboutsummaryrefslogtreecommitdiff
path: root/upload.sh
diff options
context:
space:
mode:
Diffstat (limited to 'upload.sh')
-rwxr-xr-xupload.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/upload.sh b/upload.sh
new file mode 100755
index 0000000..be9e1be
--- /dev/null
+++ b/upload.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+dir=$1; shift
+
+basedir=`pwd`
+cmd=()
+paths=()
+for path in `git status --porcelain "$dir"/*.lua|sed -n 's,^.M \(.*\),\1,p'`
+do
+ filename=`basename $path`
+ cmd+=("$path:$filename")
+ paths+=("$path")
+done
+
+if [[ ${#cmd[@]} -gt 0 ]]
+then
+ "$basedir/nodemcu-uploader/nodemcu-uploader.py" upload "${cmd[@]}"
+ git add "${paths[@]}"
+fi
+
+echo "require('main'); main();"