But I get command not found error at line hugo && rsync -avz --delete public/ ${USER}@${HOST}:${DIR}.
The unfound command is hugo. Can’t figure out why, since I could effectively build the site with hugo. The file is at the right place. Which syntax should I use?
Can you post the actual error message? And the operating system you are using? And your PATH (the environment variable PATH, that is)?
You know basic things that we don’t know about your system that are important.
Also, are you sure it is hugo that is not found and not rsync? Is rsync installed?
Finally, you say you could build using hugo. Did you build immediately before issuing the above command in the same directory (and what command line did you use?) or have you done some other ‘magic’ in the meantime?