#!/bin/bash set -e dir="$1"; shift basedir=$(pwd) cookie=$(cd $dir; echo $(pwd)/.cookie) cmd=() paths=() for path in $(ls "$dir"/cfg-* "$dir"/*.lua) do if [[ $path -nt "$cookie" ]] then filename=$(echo $path | sed -e 's,.*/\(.*\),\1,' -e 's,\.debug,,') cmd+=("$path:$filename") paths+=("$path") fi done if [[ ${#cmd[@]} -gt 0 ]] then "$basedir/nodemcu-uploader/nodemcu-uploader.py" upload "${cmd[@]}" fi touch "$cookie" if [[ -r "$dir/manual_init.lua" ]] then cat "$dir/manual_init.lua" fi