Skip to content

Watch list from file #849

@paddor

Description

@paddor

I want to watch all directories that contain source files of my app. I don't want to type -w DIR for every directory. xargs can't do this.

I'd like an option that will cause watchexec to take all watch paths from a file, one per line, just like grep -f or rsync --files-form. No need to type watchexec -w if you have the list of directories in a file.

xargs can't do this because the option -w has to be specified many times, once for each directory. The -I flag causes each command to be run with just one arg.

This works, but is not nice (Fish shell)

eval watchexec $(cat my_deps | sed -e 's/^/-w /' | sed ':a;N;s/\n/ /;ba') -- overmind restart app

I guess --watch-file would make sense, given that there's --filter/--filter-file and --ignore/--ignore-file.
As a short option, possibly -F, but I don't think a short option is needed, because this is mostly useful for automation, i.e. scripts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions