Scripts

Pre/Post Build/Serve Scripts

Nift has support for you to optinally add in pre/post build/serve scripts to your websites, you can add in batch and shell scripts, if you want to use other (scripting) languages call them from a batch script on Windows and a shell script on Unix/Linux/OSX. Just a few of the things this can be useful for include integrating with SASS, Grunt, Python webserver, Live Server, Live Reload, etc.. You can call other scripts and programs from inside your scripts, using any scripting language you want, eg. batch, bash shell, fish, Javascript, Perl, PHP, Python, Ruby, Zsh shell and many more.

Note: Make sure your scripts have executable permissions, otherwise Nift will be unable to run them and should throw a build error. You do not seem to be able to do everything you would want if installing through Snap, I am trying to work out how to fix this otherwise may stop supporting Snap (hopefully Nift can be approved for classic confinement and that will fix the problem).

On Unix (Linux/OSX) website-wide scripts should reside in the project root directory and be named as follows:

pre-build.sh
post-build.sh
pre-serve.sh
post-serve.sh

On Windows website-wide scripts should reside in the project root directory and be named as follows:

pre-build.bat
post-build.bat
pre-serve.bat
post-serve.bat

On Unix (Linux/OSX) page specific scripts should reside in the same directory as the content file for the page. For example if you have a page dir/pagename, then your scripts would reside in dir where pagename.content resides and be named as follows:

pagename.pre-build.sh
pagename.post-build.sh
pagename.pre-serve.sh
pagename.post-serve.sh

On Windows page specific scripts should reside in the same directory as the content file for the page. For example if you have a page dir/pagename, then your scripts would reside in dir where pagename.content resides and be named as follows:

pagename.pre-build.bat
pagename.post-build.bat
pagename.pre-serve.bat
pagename.post-serve.bat