From 74e42b3b4c312dc55bf940a44406d020bd160b5e Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 25 Mar 2019 20:39:07 +0100 Subject: [PATCH] [platform] improves shell environment diagnostics (IDEA-209162) --- platform/util/src/com/intellij/util/EnvironmentUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/util/src/com/intellij/util/EnvironmentUtil.java b/platform/util/src/com/intellij/util/EnvironmentUtil.java index ab4d7b324842..1256481a403d 100644 --- a/platform/util/src/com/intellij/util/EnvironmentUtil.java +++ b/platform/util/src/com/intellij/util/EnvironmentUtil.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util; import com.intellij.execution.CommandLineUtil; @@ -262,8 +262,11 @@ public class EnvironmentUtil { @NotNull protected List getShellProcessCommand() throws Exception { String shellScript = getShell(); - if (shellScript == null || !new File(shellScript).canExecute()) { - throw new Exception("shell:" + shellScript); + if (StringUtil.isEmptyOrSpaces(shellScript)) { + throw new Exception("empty $SHELL"); + } + if (!new File(shellScript).canExecute()) { + throw new Exception("$SHELL points to a missing or non-executable file: " + shellScript); } return buildShellProcessCommand(shellScript, true, true, false); }