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 stringified signal when Ctrl+C received by assets command #143

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

radar
Copy link
Contributor

@radar radar commented Feb 27, 2024

When I use hanami assets watch and then close it with Ctrl+C, I see:

hanami assets watch
[blog] [watch] build finished, watching for changes...
^C/Users/ryan.bigg/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/hanami-cli-2.1.0/lib/hanami/cli/commands/app/assets/command.rb:65:in `block (2 levels) in call': undefined local variable or method `sig' for #<Hanami::CLI::Commands::App::Assets::Watch:0x00000001103fdc00 @app=Blog::App, @out=#<IO:<STDOUT>>, @err=#<IO:<STDERR>>, @fs=#<Hanami::CLI::Files:0x00000001104fc340 @adapter=#<Dry::Files::FileSystem:0x00000001104fc1d8 @file=File, @file_utils=FileUtils>, @out=#<IO:<STDOUT>>>, @inflector=#<Dry::Inflector>, @config=#<Hanami::Config::Assets:0x0000000107cf10e0 @__config__=#<Dry::Configurable::Config values={:serve=>true}>, @base_config=#<Hanami::Assets::Config:0x0000000104e16ce8 @__config__=#<Dry::Configurable::Config values={:node_command=>"node", :path_prefix=>"/assets", :subresource_integrity=>[], :base_url=>#<Hanami::Assets::BaseUrl:0x000000011089f8f8 @url="">}>>>, @system_call=#<Hanami::CLI::InteractiveSystemCall:0x00000001108bb3c8 @out=#<IO:<STDOUT>>, @err=#<IO:<STDERR>>, @exit_after=false>> (NameError)

                  Process.kill(sig, pid)

I am not sure what sig was supposed to be here... perhaps "INT"?

@timriley timriley self-assigned this Mar 4, 2024
@timriley timriley added this to the v2.1.1 milestone Mar 4, 2024
@timriley timriley merged commit 0cce52a into hanami:main Mar 4, 2024
4 checks passed
@timriley
Copy link
Member

timriley commented Mar 4, 2024

Thanks @radar, you're exactly right! We should've been passing "INT" through.

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.

2 participants