cmd: watch
[contents]

Contents

Syntax

The syntax for the watch command is:

nsm watch dir (content-extension) (template-path) (output-extension)
nsm watch dir (content-extension) (template-path) (output-extension)

Description

The watch command is for automatically tracking and untracking files based on the existence of content files in a specified directory. The default values for content-extension, template-path and output-extension if none are provided are specified in the project configuration file .nsm/nift.config.

When a build is run, any new files in a watched directory with the specified content extension will be tracked and built, and any files where the content file has been removed will be untracked.

Note: you can watch the same directory multiple times with different content extensions, and subdirectories are not included you must watch them separately.

Example

Example of watch being used:

nift watch content
nsm watch content/blog/posts ".md"