Skip to content

CLI ​

sh
load-populate-files --file-path <module> [options]

Installed by load-populate-files. Loads the files from a config module, and writes them with populateFiles.

FlagTypeDefaultDescription
--file-pathstring—Required. The config module, relative to --cwd.
--cwdstring.Directory that every other path is resolved from.
--target-dir, -tstring.Directory that the config's filePaths are resolved from, relative to --cwd.
--ci, --checkbooleantrue in CI, false otherwiseDon't write. Fail if any file would be created, changed or removed.
--dry-runbooleanfalseDon't write files.
--cleanbooleanfalseRemove files that are no longer generated. In --ci mode, fail instead. See Clean.
--forcebooleanfalseOverwrite or remove files despite an ownership error.
--manifeststring—Path of a manifest recording the generated files, relative to --cwd.
--helpPrint usage.
--versionPrint the installed version.

Pass --no-ci to write files in CI.

sh
load-populate-files --file-path ./dist/file-content.js -t ./out                # write, or check in CI
load-populate-files --file-path ./dist/file-content.js -t ./out --ci           # fail if out of date
load-populate-files --file-path ./dist/file-content.js -t ./out \
    --manifest ./out/.generated.json --clean                                   # remove stale files
load-populate-files --file-path ./dist/file-content.js -t ./out --force        # discard hand edits

The command exits with an error, and prints it, if anything fails.