Skip to content

Log command before asking user for sudo password #415

@hohwille

Description

@hohwille

From Review of PR #409:
What I think we need to consider for runWithPackageManager is that we need to add logging of the executed command in ProcessContext before actually executing the process.

Rationale

A linux user cannot be blindly prompted for its root password from sudo without knowing what is actually happening and what command is to be executed.

Requirement

Then runWithPackageManager should log an according message on log-level interaction. So that you get something like this:

We need to run the following privileged command(s):
sudo «somecommand»
...maybe more commands...
This will require root permissions!

Please note that we also need this for other things than just global tool installations with runWithPackageManager but also e.g. for #453
Therefore the logging itself should be implemented in a method that can be reused for other use-cases than executePackageManagerCommand.

Hint

Needs to be added here:

String bashPath = this.context.findBashRequired();

Metadata

Metadata

Assignees

Labels

CLIIDEasy command-line-interface (parsing args, etc.)enhancementNew feature or requestinstallinstallation process of IDE + tools and install commandletlinuxspecific for linux OS (debian, ubunutu, suse, etc.)

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions