Skip to content
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

silent npm run #26

Closed
iamstarkov opened this issue Aug 12, 2015 · 11 comments
Closed

silent npm run #26

iamstarkov opened this issue Aug 12, 2015 · 11 comments

Comments

@iamstarkov
Copy link

why did you choose run npm scripts in silent? usually its hiding some problems

prepush: "npm run unexisting",

husky will fail, and you will have no idea what is a problem

@typicode
Copy link
Owner

Originally, it was to make hooks output less verbose and more readable:

$ npm run test
src/actions/daemon.js -> lib/actions/daemon.js
src/actions/servers.js -> lib/actions/servers.js
...

vs

$ npm run test

> [email protected] test /home/typicode/d/hotel
> npm run build && mocha && npm run standard 


> [email protected] build /home/typicode/d/hotel
> babel src --out-dir lib --copy-files --loose all

src/actions/daemon.js -> lib/actions/daemon.js
src/actions/servers.js -> lib/actions/servers.js
...

Though, I agree that it hides things.

But if you need to debug stuff, you can run npm run prepush and you'll get the full output. That's one of the cool thing of having them defined in package.scripts.

@iamstarkov
Copy link
Author

I thought about it sometime, and ended up with thought that its nice to hide if everything is okay, but if it failed, then it will be better to show the error message. what do you think?

@scotthovestadt
Copy link

I thought about it sometime, and ended up with thought that its nice to hide if everything is okay, but if it failed, then it will be better to show the error message. what do you think?

+1

@iamstarkov
Copy link
Author

@typicode any thoughts?

@typicode
Copy link
Owner

Sorry, forgot to reply. I'm currently on vacation with just my phone, will make a better/more detailed answer when I get back :)

@andrew-makarenko
Copy link

I found this behaviour confusing, so it would be great to add some note about this in the readme.
Smth like 'Hook scripts will be runned with --silent flag, so you wouldn't see any information passed to STDOUT by your script. If you need to debug your script, you can run it manually npm run prepush'

@typicode
Copy link
Owner

Sorry for the delay.

I've removed the --silent option and published v0.10.2. As suggested by @iamstarkov, things will be more explicit this way.

Thank you all for the feedbacks :)

@iamstarkov
Copy link
Author

@typicode just saying "thanks for husky and your time" again =)

@pgom
Copy link

pgom commented Jan 18, 2016

@typicode actually it would be great if the silent (or other) flag could be used as an option. What do you think?

@typicode
Copy link
Owner

I prefer to avoid adding options to keep it simple and I'm kind of satisfied with husky not being silent. Also I'm not sure what other flag could be added?

@lili21
Copy link

lili21 commented Mar 31, 2016

I think optional silent would be helpful. When I am using git hooks for linting source code, those lint errors would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants