Skip to content

A platform for community discussion. Free, open, simple.

DEV: Use the correct open command in the version bump rake task (#27046)

Jan Cernikaf6759f5e235
diff --git a/lib/tasks/version_bump.rake b/lib/tasks/version_bump.rake
index 8ce4715c6fe..9107e7c8b4a 100644
--- a/lib/tasks/version_bump.rake
+++ b/lib/tasks/version_bump.rake
@@ -103,13 +103,25 @@ end
def make_pr(base:, branch:, title:)
params = { expand: 1, title: title, body: <<~MD }
> :warning: This PR should not be merged via the GitHub web interface
- >
+ >
> It should only be merged (via fast-forward) using the associated `bin/rake version_bump:*` task.
MD
if !test_mode?
+ open_command =
+ case RbConfig::CONFIG["host_os"]
+ when /darwin|mac os/
+ "open"
+ when /linux|solaris|bsd/
+ "xdg-open"
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
+ "start"
+ else
+ raise "Unsupported OS"
+ end
+
system(
- "open",
+ open_command,
"https://github.com/discourse/discourse/compare/#{base}...#{branch}?#{params.to_query}",
exception: true,
)