Giter Club home page Giter Club logo

Comments (17)

garygreen avatar garygreen commented on July 21, 2024 1

+1 would like to watch a single file but can't seem ? (trying by CLI)

from watch.

luochen1990 avatar luochen1990 commented on July 21, 2024 1

+1 I think not only one file but also a glob expr should be accepted by the cli.
since we often need something like this:

watch "coffee -c *.coffee" *.coffee

from watch.

tomwidmer avatar tomwidmer commented on July 21, 2024 1

N.B. watch-run supports single files and globs, i.e.:

watch-run -p myfile "cp myfile dist/"
watch-run -p *.coffee "coffee -c *.coffee"

(just mentioning it since it appears watch isn't particularly actively maintained, and I found an alternative)

from watch.

finnp avatar finnp commented on July 21, 2024

Why not use http://nodejs.org/api/fs.html#fs_fs_watch_filename_options_listener if you are are only watching one file?

from watch.

jonataswalker avatar jonataswalker commented on July 21, 2024

Same reason I found this issue. +1

from watch.

ajmesa9891 avatar ajmesa9891 commented on July 21, 2024

It would be very useful to watch only one file using the CLI. +1

from watch.

divmgl avatar divmgl commented on July 21, 2024

+1 any update on this?

To answer @finnp, some configurations would benefit from this. For instance, my current configuration has an index.js file and a src file. If I were to change index.js, watch would not trigger a event.

watch "npm run js" index.js src

I may open a pull request.

from watch.

luochen1990 avatar luochen1990 commented on July 21, 2024

@tomwidmer thx

from watch.

tnguyen14 avatar tnguyen14 commented on July 21, 2024

@rgherk were you gonna create a PR for your implementation?

from watch.

roopemerikukka avatar roopemerikukka commented on July 21, 2024

+1 for this

from watch.

sarukuku avatar sarukuku commented on July 21, 2024

+1 from me too! Are you planning on implementing this or are we waiting for nothing? I'm asking as this conversation has now been open since Dec 10, 2014.

from watch.

levithomason avatar levithomason commented on July 21, 2024

@sarukuku it's a +1 from me and likely most watch users out there. I'm a contributor here and the plans are always to make everything is great as it can be. I don't have time at present. PRs absolutely welcome.

from watch.

sarukuku avatar sarukuku commented on July 21, 2024

@levithomason ofc, good to hear that this has been noted and that the issue isn't "dead". I'd like to help in fixing this but I think this kind of issue is out of my league. :)

from watch.

sarukuku avatar sarukuku commented on July 21, 2024

@levithomason it seems that @rgherk has created a possible fix for this. Could we use this?

from watch.

divmgl avatar divmgl commented on July 21, 2024

If anyone is still struggling with this, use https://github.com/Qard/onchange instead. I'm unsubscribing from this issue.

from watch.

levithomason avatar levithomason commented on July 21, 2024

@sarukuku watch is hardly in my workflow anymore so it doesn't get much attention from me. I did ask @rgherk for some tests. Also, that PR is very outdated and needs rebased. My concern with merging it is that it refactors a core part of watch with lots of business logic. I don't have time to grok it and make sure it is done right.

If there were some tests, I'd feel much better releasing it.

from watch.

moxdev avatar moxdev commented on July 21, 2024

N.B. watch-run supports single files and globs, i.e.:

watch-run -p myfile "cp myfile dist/"
watch-run -p *.coffee "coffee -c *.coffee"

(just mentioning it since it appears watch isn't particularly actively maintained, and I found an alternative)

Ended up using @tomwidmer suggestion and it works great thanks!

from watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.