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 system_command instead of system in Casks #23070

Closed
1 of 3 tasks
jawshooah opened this issue Jul 24, 2016 · 4 comments
Closed
1 of 3 tasks

Use system_command instead of system in Casks #23070

jawshooah opened this issue Jul 24, 2016 · 4 comments

Comments

@jawshooah
Copy link
Contributor

jawshooah commented Jul 24, 2016

system_command was introduced way back in #5723 as an interface for Casks to run shell commands in *flight blocks without using backticks or Kernel#system, allowing us to capture the output and error out if the command failed.

We've had some issues in the past where Casks silently failed to install or uninstall because a system call in a *flight block failed but no error was raised. Using system_command, such failures will be made apparent to the user, and thus to us when users create bug reports.

We should also create a cop over in rubocop-cask to check for instances of system and warn the user to replace them with system_command. We could even make it autocorrect to further reduce the burden on the user.


Action items:

  • Replace existing instances of system in Casks with system_command
  • Create a cop to warn when a Cask uses system instead of system_command
    • Teach the cop to autocorrect
@jawshooah jawshooah added enhancement core Issue with Homebrew itself rather than with a specific cask. labels Jul 24, 2016
@tsparber
Copy link
Contributor

tsparber commented Aug 1, 2016

Would it also be possible to just "overwrite" the Kernel#system command in a similar way as homebrew does it?

@jawshooah
Copy link
Contributor Author

This is their overridden system method that's exposed to Formula authors; we could potentially do something similar by exposing a system method on Hbc::DSL::Base.

@miccal
Copy link
Contributor

miccal commented Jan 24, 2017

First Action item is complete - all instances of system have been replaced with system_command in all repositories.

@vitorgalvao
Copy link
Contributor

@miccal miccal removed core Issue with Homebrew itself rather than with a specific cask. enhancement labels Feb 2, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants