mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added a helper method for path-like env variables
This commit is contained in:
+14
@@ -20,6 +20,7 @@ import com.intellij.execution.process.ProcessNotCreatedException;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -37,6 +38,19 @@ public class GeneralCommandLine {
|
||||
private ParametersList myProgramParams = new ParametersList();
|
||||
private Charset myCharset = CharsetToolkit.getDefaultSystemCharset();
|
||||
|
||||
/**
|
||||
* Appends a value to the end os a path-like environment variable, using system-dependent path separator.
|
||||
* @param source path-like string to append to
|
||||
* @param value what to append
|
||||
* @return modified path-like string
|
||||
*/
|
||||
@NotNull
|
||||
public static String appendToPathEnvVar(@Nullable String source, @NotNull String value) {
|
||||
if (source != null) source = value + File.pathSeparator + source;
|
||||
else source = value;
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setExePath(@NonNls final String exePath) {
|
||||
myExePath = exePath.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user