import com.google.common.collect.Lists;
import com.intellij.execution.TaskExecutor;
-import com.intellij.execution.configurations.EncodingEnvironmentUtil;
import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
return name.equals("bash") || name.equals("sh") || name.equals("zsh");
}
- private static String getShellName(String path) {
- return new File(path).getName();
+ private static String getShellName(@Nullable String path) {
+ if (path == null) {
+ return null;
+ }
+ else {
+ return new File(path).getName();
+ }
}
private static String findRCFile(String shellName) {
if (SystemInfo.isUnix) {
List<String> command = Lists.newArrayList(shellPath.split(" "));
- String shellCommand = command.get(0);
- String shellName = command.size() > 0 ? getShellName(shellCommand) : null;
-
+ String shellCommand = command.size() > 0 ? command.get(0) : null;
+ String shellName = getShellName(shellCommand);
if (shellName != null) {
command.remove(0);