Module: SystemCommand::Mixin
- Included in:
- AbstractDownloadStrategy, Cask::Appcast, Cask::Artifact::AbstractUninstall, Cask::Audit, Cask::CI::Check, Cask::CI::ZapCheck, Cask::Quarantine, Cask::TokenGenerator, Cask::Utils::Trash, GitHub, GitHub::API, GitHubPackages, Homebrew::Attestation, Homebrew::Bump, Homebrew::BundleVersion, Homebrew::Cmd::List, Homebrew::DevCmd::Benchmark, Homebrew::DevCmd::BumpUnversionedCasks, Homebrew::DevCmd::Contributions, Homebrew::DevCmd::GenerateManCompletions, Homebrew::DevCmd::GenerateZap, Homebrew::DevCmd::Lgtm, Homebrew::DevCmd::TapNew, Homebrew::DevCmd::Tests, Homebrew::DevCmd::UpdateLicenseData, Homebrew::DevCmd::UpdateMaintainers, Homebrew::DevCmd::UpdateSponsors, Homebrew::Diagnostic::Checks, Homebrew::InstallSteps::Runner, Homebrew::Livecheck::Strategy::Git, Homebrew::Style, Homebrew::TestBot::Step, Homebrew::UnversionedCaskChecker, OS::Linux::SystemConfig::ClassMethods, OS::Mac::Keg, Pathname, SystemConfig, UnpackStrategy, UnpackStrategy::Dmg, UnpackStrategy::Dmg::Bom, UnpackStrategy::Fossil, UnpackStrategy::Path, UnpackStrategy::Tar, User, Utils::Curl, Utils::Curl, Utils::Git, Utils::Svn, Utils::Tar
- Defined in:
- system_command.rb
Overview
Instance Method Summary collapse
- #command_sandbox ⇒ Sandbox? private
-
#system_command(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], must_succeed: false, print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) ⇒ SystemCommand::Result
internal
Run a fallible system command.
-
#system_command!(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) ⇒ SystemCommand::Result
internal
Run an infallible system command.
Instance Method Details
#command_sandbox ⇒ Sandbox?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
22 |
# File 'system_command.rb', line 22 def command_sandbox = nil |
#system_command(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], must_succeed: false, print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) ⇒ SystemCommand::Result
This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Run a fallible system command.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'system_command.rb', line 45 def system_command(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], must_succeed: false, print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) if (sandbox = command_sandbox) Kernel.raise ArgumentError, "Sandboxed commands cannot use sudo" if sudo || sudo_as_root return sandbox.capture(executable, args:, env:, input:, must_succeed:, print_stdout:, print_stderr:, debug:, verbose:, secrets:, chdir:, timeout:) end SystemCommand.run(executable, args:, sudo:, sudo_as_root:, env:, input:, must_succeed:, print_stdout:, print_stderr:, debug:, verbose:, secrets:, chdir:, timeout:) end |
#system_command!(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) ⇒ SystemCommand::Result
This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Run an infallible system command.
79 80 81 82 83 84 |
# File 'system_command.rb', line 79 def system_command!(executable, args: [], sudo: false, sudo_as_root: false, env: {}, input: [], print_stdout: false, print_stderr: true, debug: nil, verbose: nil, secrets: [], chdir: nil, timeout: nil) system_command(executable, args:, sudo:, sudo_as_root:, env:, input:, must_succeed: true, print_stdout:, print_stderr:, debug:, verbose:, secrets:, chdir:, timeout:) end |