-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor script to allow for environment variables #9
Comments
Ref #9 Makes evaluation of commands passed via `-x, --exec` more robust. Adds the ability to declare the command to run on source changes as an environment variable.
Ref #9 Adds support for the debug env variable, and adds a integer to bool conversion fn that can be used on other env vars in the future if conversion is necessary
Ref #9 Adds script support for the `clear` env variable
Ref #9 Adds script support for `ignore-nothing` env var, and reorder logic regarding the ignore patterns
Ref #9 Add script support for `no-restart` env var
Ref #9 Adds script support for postpone env var
Ref #9 Updates `process_command` function to accept an array and return a processed array. Updates the name of `process_command` to `process_args` to better reflect its use cases. Enables detection of `NIX_WATCH_SHELL_ARGS` environment variable, yielding to command line args passed.
would you mind also move script into separate file out of nix and make also you may consider using https://github.com/ko1nksm/getoptions by refencing it as non flake input? it parses into ENV vars kind of as it seems. |
Do you have an example of how someone would use this in a non-nix setting? It's a nix developer tool, so I only really see anyone using it with nix. |
It would be cool to allow environment variables for variables in the script that rely on the command line flags so that the watcher could be declarative. Basically I'd like to be able to do:
How the default variables are constructed would need to change. The following is the behaviour I'd expect:
NIX_WATCH_COMMAND="nix build --keep-going"
but the user specifiesnix-watch -x "nix flake check"
There may be other quirks that will present themselves as I haven't entirely thought this out, but that's the gist.
The text was updated successfully, but these errors were encountered: