-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling hooks via env variables #3618
Comments
@zivc Adding a semicolon doesn't seem to do anything, running 'sails_hooks__grunt=false; sails lift --verbose' still has grunt output. Just for extra clarification, I am running this directly using the cli by setting the environment variable in line. |
Not sure if it'll work but can you try setting it as 0? sails_hooks__grunt=0 sails lift ? As you rightly said process.env are defaulted as strings only. |
@Mudrekh alas, that's environment variables for you. I can patch this for hooks, because it'd be handy to be able to turn them off via environment configs, but there's no general fix we can make here because a) we use another module ( |
@Mananj That would also be passed as a string, so even if you did a truthy test on it, it wouldn't pass hook loading in loadHooks..js @sgress454 That seems reasonable. A patch would definitely be better than nothing. I assume something simple like just adding hookPrototype === 'false' in loadHooks.js at line 22? |
While trying to start our sails app in different ways, I encountered this error while trying to disable hooks (specifically grunt) by setting an environment variable.
Using 'sails_hooks__grunt=false sails lift' causes this to be thrown
error: Malformed hook! (grunt)
error: Hooks should be a function with one argument (
sails
)Looking a little deeper, it seems like process.env variables are restricted to strings, but ./lib/app/private/loadHooks.js is specifically looking for Boolean literals.
The text was updated successfully, but these errors were encountered: