Skip to content

Add support for sudo installation missing packages after init #350

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

Open
wants to merge 3 commits into
base: release/1.0
Choose a base branch
from

Conversation

cmcgee1024
Copy link
Member

Currently when there is a post installation command during init the user is given the command that they must run at the end. In order to streamline the process further an additional flag called '--sudo-install-packages' is added that will invoke sudo on behalf of the user to perform that command as root.

Add the new flag to the init subcommand. Create a regex that restricts the allowable commands to a narrow set of patterns as a measure of protection. Invoke the sudo process directly from the expected directory on supported Linux systems, which is /usr/bin/sudo

Currently when there is a post installation command during init
the user is given the command that they must run at the end. In
order to streamline the process further an additional flag called
'--sudo-install-packages' is added that will invoke sudo on behalf
of the user to perform that command as root.

Add the new flag to the init subcommand. Create a regex that
restricts the allowable commands to a narrow set of patterns as a
measure of protection. Invoke the sudo process directly from the
expected directory on supported Linux systems, which is /usr/bin/sudo
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

p.waitUntilExit()

if p.terminationStatus == 0 {
SwiftlyCore.print("sudo could not be run to install the packages")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could go in the common messages struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants