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

Feature request: Add a flag that only restarts the program when a file is updated. #1

Open
Stromdahl opened this issue Aug 2, 2023 · 0 comments

Comments

@Stromdahl
Copy link

Stromdahl commented Aug 2, 2023

Feature Request:

Add a flag that only restarts the program when a file is updated.

Description:

Developing a program that's intended to exit can be challenging with Runar, as it currently restarts the program every time. This can lead to repetitive output and unnecessary restarts.

Example:
$ runar -r -f myscript.sh -- ./myscript.sh 
START
PROCESSING...
END
START
PROCESSING...
END
START
PROCESSING...
END
START
PROCESSING...
END
START
...
Proposed Solution:

To address this, I propose introducing a -w (or -wait) flag to Runar. When this flag is used, Runar would only initiate a restart when a file update is detected. This feature would greatly improve the development experience.

Proposed Example:
# With the proposed -w flag
$ runar -r -w -f myscript.sh -- ./myscript.sh 
START
PROCESSING...
END
<runar> child process exited with  0... Runar is now waiting for a file update...
Benefits:
  • Enhanced Development Experience: The new -w flag would prevent unnecessary restarts, making it easier to work on programs meant to exit.
Implementation Note:

As for implementation, Runar would need to monitor the specified file for changes and trigger a restart only when updates occur.

Additional Notes:
  • This feature could significantly reduce repetitive output during development.
  • The proposed flag name is -w, but you could consider alternatives...
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

1 participant