#!/bin/sh # output a gzip compressed tar archive suitable for release # input is a uncompressed tar or pax archive (from git archive) # example: # git archive HEAD | release | # ssh esp "mkdir esp2local && cd esp2local && tar xz" [ "$PWD" != "$ESPhome" ] && { echo "WARNING: current directory is not $ESPhome ($ESPhome)" >&2 sleep 5 } tmpdir=/tmp/$USER/esp2 rm -rf $tmpdir && mkdir -p $tmpdir cd $tmpdir || exit $? tar x || exit $? rm -rf test #remove the test directory for deployment in flash files=$(find -type f) chmod -w $files tar cz --xform 's,^./,,' $files