diff --git a/cmd/lib/changed_files.rb b/cmd/lib/changed_files.rb index 8b04c02c96..a3cc144fa2 100644 --- a/cmd/lib/changed_files.rb +++ b/cmd/lib/changed_files.rb @@ -1,6 +1,12 @@ # frozen_string_literal: true +require "system_command" + module ChangedFiles + # TODO: replace with public API like Utils.safe_popen_read that's less likely to be volatile to changes + # see https://github.com/Homebrew/brew/pull/16540#issuecomment-1913737000 + include SystemCommand::Mixin + def changed_files commit_range_start = system_command!("git", args: ["rev-parse", "origin"], chdir: path).stdout.chomp commit_range_end = system_command!("git", args: ["rev-parse", "HEAD"], chdir: path).stdout.chomp diff --git a/cmd/lib/check.rb b/cmd/lib/check.rb index 587a45658a..3bd98953b8 100644 --- a/cmd/lib/check.rb +++ b/cmd/lib/check.rb @@ -1,12 +1,16 @@ -# typed: false # frozen_string_literal: true require "forwardable" +require "system_command" APPLE_LAUNCHJOBS_REGEX = /\A(?:application\.)?com\.apple\.(installer|Preview|Safari|systemevents|systempreferences|Terminal)(?:\.|$)/ module Check + # TODO: replace with public API like Utils.safe_popen_read that's less likely to be volatile to changes + # see https://github.com/Homebrew/brew/pull/16540#issuecomment-1913737000 + extend SystemCommand::Mixin + CHECKS = { installed_apps: lambda { ["/Applications", File.expand_path("~/Applications")]