Just an update for a script in Zsh instead of Bash and rsync for Hugo.

zsh - the Z Shell - is the default terminal shell for newer macs replacing bash

this means zsh scripts need to change ..

Change first line from sh to zsh

1
2
3
4
5
6
7
8
#!/bin/zsh
USER=my-user
HOST=my-server.com             
DIR=my/directory/to/localsite/   # the directory where your web site files should go

hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}

exit 0

my preferred rsync options are

-ah --stats --delete

so its silent, tells stats and deletes old files

follow the rest of the linkage .. to chmod and make executable

Linkage