Add a corresponding default command to the viur-base's Pipfile, like https://github.com/viur-framework/viur-core/blob/dd0431bc14c2a2b897f2f54de092cac45b0d5e71/Pipfile#L21. At the end is the project logic.
And the CLI then executes defined commands in the project.json as pre-action hooks.
For example:
{
"//": "[...]",
"default": {
"application_name": "myproject-with-hooks",
"actions": {
"pre-deploy": [{
"command": "pipenv run linter",
"kind": "exec",
}, {
"kind": "viur-cli-build",
}],
"pre-devserver": [{
"command": "pipenv run dependency_check",
"kind": "exec",
}, {
"command": "npm run watch",
"kind": "exec-background",
}],
},
},
"//": "[...]",
}
Originally posted by @sveneberth in #158 (review)
Add a corresponding default command to the
viur-base'sPipfile, like https://github.com/viur-framework/viur-core/blob/dd0431bc14c2a2b897f2f54de092cac45b0d5e71/Pipfile#L21. At the end is the project logic.And the CLI then executes defined commands in the
project.jsonas pre-action hooks.For example:
{ "//": "[...]", "default": { "application_name": "myproject-with-hooks", "actions": { "pre-deploy": [{ "command": "pipenv run linter", "kind": "exec", }, { "kind": "viur-cli-build", }], "pre-devserver": [{ "command": "pipenv run dependency_check", "kind": "exec", }, { "command": "npm run watch", "kind": "exec-background", }], }, }, "//": "[...]", }Originally posted by @sveneberth in #158 (review)