From: equilet <2237372+equilet@users.noreply.github.com> Date: Wed, 6 Mar 2024 03:53:32 +0000 (-0600) Subject: adding publishing script X-Git-Tag: v1.0~12 X-Git-Url: https://git.dabkitsch.com/?a=commitdiff_plain;h=3510a025cc4b3737a9433b0ef89da71e6f15b71c;p=m29-web-sfp.git adding publishing script --- diff --git a/publish.zsh b/publish.zsh new file mode 100755 index 0000000..92bd502 --- /dev/null +++ b/publish.zsh @@ -0,0 +1,40 @@ +#!/bin/zsh + +server_path=jlubow@dabkitsch.com:/home/jlubow/sketch.dabkitsch.com/m29/m29_sfp +rootdirs=(media js style) +rootfiles=(favicon.ico index.html) + +if [ -d _upload ] +then + echo 'found a previously existing upload dir; removing...' + rm -rf _upload/* + rm _upload +else + echo 'creating upload directory' + mkdir _upload +fi + +for dir in $rootdirs; do + echo 'copying dirs: ' $dir + cp -rf $dir _upload +done + +for file in $rootfiles; do + echo 'copying files: ' $file + cp $file _upload +done + +echo 'upload designated: sketch dabk m29 m29_sfp' + +#---------------------------------------------------------- +#note: careful. this blasts dest on server + +#echo 'warning: rsync is in dry-run mode; update script to execute normally' +#rsync -avz --dry-run --delete $upload_dir/ $server_path + +echo 'rsync running in regular mode.' +rsync -avz --delete _upload/ ${server_path}/ + +#echo 'removing (temp) upload directory...' +#rm -rf $upload_dir +