From 967254d72ba5e116f3019937660c346d202af7f7 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 3 Oct 2015 17:14:41 +0200 Subject: wip --- upload.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'upload.sh') diff --git a/upload.sh b/upload.sh index be9e1be..e9166c4 100755 --- a/upload.sh +++ b/upload.sh @@ -1,22 +1,27 @@ #!/bin/bash set -e -dir=$1; shift +dir="$1"; shift -basedir=`pwd` +basedir=$(pwd) +cookie=$(cd $dir; echo $(pwd)/.cookie) cmd=() paths=() -for path in `git status --porcelain "$dir"/*.lua|sed -n 's,^.M \(.*\),\1,p'` + +for path in $(ls "$dir"/cfg-* "$dir"/*.lua) do - filename=`basename $path` - cmd+=("$path:$filename") - paths+=("$path") + if [[ $path -nt "$cookie" ]] + then + filename=`basename $path` + cmd+=("$path:$filename") + paths+=("$path") + fi done if [[ ${#cmd[@]} -gt 0 ]] then - "$basedir/nodemcu-uploader/nodemcu-uploader.py" upload "${cmd[@]}" - git add "${paths[@]}" + "$basedir/nodemcu-uploader/nodemcu-uploader.py" --baud 115200 upload "${cmd[@]}" fi +touch "$cookie" echo "require('main'); main();" -- cgit v1.2.3