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

Use Kernel.exec instead of system #17

Closed
wants to merge 1 commit into from
Closed

Conversation

fschwahn
Copy link
Contributor

Currently, when ending the watch process, something like this is printed:

^Crails aborted!
Interrupt: 
/Users/fabian/code/rails/app/bin/rails:5:in `<top (required)>'
/Users/fabian/code/rails/app/bin/spring:10:in `block in <top (required)>'
/Users/fabian/code/rails/app/bin/spring:7:in `<top (required)>'
Tasks: TOP => dartsass:watch
(See full trace by running task with --trace)

When using Kernel.exec the rake process is replaced with the dartsass process, so the signal goes directly to dartsass, properly ending the process.

I adopted this from webpacker, see https://github.com/rails/webpacker/blob/14dcce2c23a207062e0fc4ebed6042381dabd66a/lib/webpacker/dev_server_runner.rb#L87-L89

Kernel.exec replaces the current process with the one called, eliminating errors from rake when ending the watch process.

Adjusted dartsass:build as well for consistency.
@fschwahn
Copy link
Contributor Author

In light of rails/tailwindcss-rails#189 I'm going to close this.

@fschwahn fschwahn closed this Aug 10, 2022
@fschwahn fschwahn deleted the exec branch August 10, 2022 07:54
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

Successfully merging this pull request may close these issues.

1 participant