RickWong / wait-run

Wait for a file or directory to change or appear, then run a command once.
16 stars 8 forks source link

Thank you for this! #1

Open Download opened 8 years ago

Download commented 8 years ago

Hah! I saw you added wait-run to the react-isomorphic-starterkit.. quickly checked it and realized it was a utility to wait for a file to change (which makes a lot more sense then waiting for the dev server btw, was a brain fart of mine :), however, I didn't notice you had created this package as well...

I find it really cool the way you help out the entire community. I am now using this package as well, so THANK YOU!!

RickWong commented 8 years ago

Yeah I couldn't find a package that would wait for non-existent files to appear, they all just watched existing files or directories only... So I created one.

And wait-run only runs just once and then exits. None of the other watchers has this option.

RickWong commented 8 years ago

By the way, I did start attempting to listen to the dev server, but apparently Webpack HMR communication to Node is file-based. So there was no dev server with a port listening. Only an initial server.js and later hash.json updates are outputted, and "webpack/hot/poll" then goes looking for hash.json update files to require().

So in the starterkit wait-run awaits the initial server.js to change or appear.

Download commented 8 years ago

Yes. I was actually listening for the dev server to start serving files to the client before starting the server... It sorta worked out but it doesn't really make sense as a solution.

I hope you don't mind but I'm changing your utitlity around a little bit and re-releasing it as just-wait... I don't even want it to run that single command... I do that myself. I now use it like this:

just-wait -p somefile.js && echo Go!

Also, I added options for a timeout and some logging and of course options to suppress that logging. I forked your project because I felt the changes would maybe be too radical for you :) If you'd like to merge them instead just let me know. I put you down as the author of the new project and myself as a collaborator...

RickWong commented 8 years ago

Oh please don't. It's your idea and your work, and if you mention someone it should really be @queckezz.

By the way, I like the unix-y concept of just-wait and if it's possible, I'll use it for the starterkit instead. :+1:

Download commented 8 years ago

I'd be honored if you would use it for the starterkit! :+1:

I'll add @queckezz to the credits :)

Download commented 8 years ago

I've dropped a mention of our projects in @queckezz issue list. Specifically I am asking him if it's ok if users of just-wait take their pick from any of the licenses. We are all three using different licenses and that's ok but it may be confusing for the user.

So I'd like to ask you as well... Is it ok for users to take their pick from MIT / BSD / CC licenses?