diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-11-19 19:33:05 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-11-19 19:33:05 +0100 |
commit | 937040944ffdf7819b7ce7bee23a3d346718c0e4 (patch) | |
tree | db408e56ae414db637b1e58717d99bceda2cfcd5 /upload.sh | |
parent | 46f5784e3acb277aab44217e2521625ffe043d35 (diff) | |
download | esp-playground-master.tar.gz esp-playground-master.tar.bz2 esp-playground-master.tar.xz esp-playground-master.zip |
Diffstat (limited to 'upload.sh')
-rwxr-xr-x | upload.sh | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -7,8 +7,15 @@ basedir=$(pwd) cookie=$(cd $dir; echo $(pwd)/.cookie) cmd=() paths=() +port=() -for path in $(ls "$dir"/cfg-* "$dir"/*.lua 2>/dev/null) +if [[ $NODEMCU_PORT != '' ]] +then + port+=(--port) + port+=("$NODEMCU_PORT") +fi + +for path in $(ls "$dir"/cfg-* "$dir"/*.lua |grep -v manual_init.lua 2>/dev/null) do if [[ $path -nt "$cookie" ]] then @@ -20,12 +27,12 @@ done if [[ ${#cmd[@]} -gt 0 ]] then - "$basedir/nodemcu-uploader/nodemcu-uploader.py" upload "${cmd[@]}" + "$basedir/nodemcu-uploader/nodemcu-uploader.py" "${port[@]}" upload "${cmd[@]}" fi touch "$cookie" if [[ -r "$dir/manual_init.lua" ]] then - cat "$dir/manual_init.lua" - "$basedir/nodemcu-uploader/nodemcu-uploader.py" exec "$dir/manual_init.lua" +# cat "$dir/manual_init.lua" + "$basedir/nodemcu-uploader/nodemcu-uploader.py" "${port[@]}" exec "$dir/manual_init.lua" fi |