Skip to content

Commit

Permalink
[MSHARED-1014] Make Commandline.addSystemEnvironment public and depre…
Browse files Browse the repository at this point in the history
…cated

MavenInvoker still use it.
  • Loading branch information
slawekjaranowski committed Apr 21, 2023
1 parent b60e8a2 commit 462bd11
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ public void addEnvironment(String name, String value) {

/**
* Add system environment variables.
*
* @deprecated please use {@link #setShellEnvironmentInherited(boolean)}
*/
private void addSystemEnvironment() {
@Deprecated
public void addSystemEnvironment() {}

private void copySystemEnvironment() {
Properties systemEnvVars = CommandLineUtils.getSystemEnvVars();

for (Object o : systemEnvVars.keySet()) {
Expand All @@ -202,7 +207,7 @@ private void addSystemEnvironment() {
*/
public String[] getEnvironmentVariables() {
if (isShellEnvironmentInherited()) {
addSystemEnvironment();
copySystemEnvironment();
}

List<String> environmentVars = new ArrayList<>();
Expand Down

0 comments on commit 462bd11

Please sign in to comment.