From 50065d182fea2e44505bc57907a91ce12fada78b Mon Sep 17 00:00:00 2001 From: "Billy.Zheng" Date: Fri, 6 Dec 2024 11:50:12 +0800 Subject: [PATCH] Initial windows support: https://github.com/samueleaton/sentry/pull/68 1. Use process.terminate instead of signal(:kill) 2. Terminate app process before rebuilding on Windows --- src/sentry/process_runner.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sentry/process_runner.cr b/src/sentry/process_runner.cr index 608cfff..b9faad7 100644 --- a/src/sentry/process_runner.cr +++ b/src/sentry/process_runner.cr @@ -139,6 +139,14 @@ module Sentry private def build_app_process : Process::Status stdout "🤖 compiling #{@display_name}..." + {% if flag?(:win32) %} + if (app_process = @app_process).is_a? Process + stdout "🤖 killing #{@display_name}..." + app_process.terminate + # app_process.wait + end + {% end %} + Process.run( @build_command, @build_args_list, @@ -151,7 +159,7 @@ module Sentry if (app_process = @app_process).is_a? Process unless app_process.terminated? stdout "🤖 killing #{@display_name}..." - app_process.signal(:kill) + app_process.terminate app_process.wait end end