[platform] fixes IDE launch from a bin/ directory on Unix (IDEA-161265)
[idea/community.git] / bin / scripts / unix / idea.sh
index 2bfd582f3f6249918a4bbb6ec03180cea9de9a1c..786a99486585ec0951ff14c863cb786f3dc1e39a 100755 (executable)
@@ -51,7 +51,11 @@ if [ -x "$READLINK" ]; then
 fi
 
 IDE_BIN_HOME=`dirname "$SCRIPT_LOCATION"`
-IDE_HOME=`dirname "$IDE_BIN_HOME"`
+if [ "$IDE_BIN_HOME" = "." ]; then
+  IDE_HOME=".."
+else
+  IDE_HOME=`dirname "$IDE_BIN_HOME"`
+fi
 
 # ---------------------------------------------------------------------
 # Locate a JDK installation directory which will be used to run the IDE.