diff --git a/documentation/android-studio.asciidoc b/documentation/android-studio.asciidoc index 0a8b74f2a..be4eb07f1 100644 --- a/documentation/android-studio.asciidoc +++ b/documentation/android-studio.asciidoc @@ -34,6 +34,7 @@ These are explained by the following table: |*Variable*|*Meaning* |*`ANDROID_STUDIO_VERSION`*|The version of the tool Android Studio to install and use. |*`EXTRA_JAVA_VERSION`*|You can set this to a different (newer) version of Java used to launch your IDE (other than `JAVA_VERSION` that is used to build your project) +|*`ANDROID_STUDIO_DISABLE_OPEN_WORKSPACE`*|`true` will disable that your workspace folder will be opened automatically (legacy behavior), `false` will enable to open your workspace folder. See https://github.com/devonfw/ide/issues/1358[#1358] for details. |======================= == plugins diff --git a/documentation/intellij.asciidoc b/documentation/intellij.asciidoc index bce503046..4fdad20f3 100644 --- a/documentation/intellij.asciidoc +++ b/documentation/intellij.asciidoc @@ -35,6 +35,7 @@ These are explained by the following table: |*`INTELLIJ_VERSION`*|The version of the tool IntelliJ to install and use. |*`INTELLIJ_EDITION`*|The edition of the tool IntelliJ to install and use. By default the Community edition will be installed. If you want to use the Ultimate Edition, the value has to be set to `ultimate`. The Ultimate edition requires a license. The user has to buy the license separately and it is not part of devonfw-ide. The devonfw-ide only supports download and installation. |*`EXTRA_JAVA_VERSION`*|You can set this to a different (newer) version of Java used to launch your IDE (other than `JAVA_VERSION` that is used to build your project) +|*`INTELLIJ_DISABLE_OPEN_WORKSPACE`*|`true` will disable that your workspace folder will be opened automatically (legacy behavior), `false` will enable to open your workspace folder. See https://github.com/devonfw/ide/issues/1358[#1358] for details. |======================= == plugins diff --git a/scripts/src/main/resources/scripts/command/android-studio b/scripts/src/main/resources/scripts/command/android-studio index 3166b8673..5c6fee35f 100644 --- a/scripts/src/main/resources/scripts/command/android-studio +++ b/scripts/src/main/resources/scripts/command/android-studio @@ -140,10 +140,20 @@ function doStartAndroidStudio() { if doIsMacOs then echo "MacOs command ${STUDIO}" - open -na "${STUDIO}" "${WORKSPACE_PATH}" --args "${@}" + if [ "${ANDROID_STUDIO_DISABLE_OPEN_WORKSPACE}" = "true" ] + then + open "${STUDIO}" --args "${@}" + else + open -na "${STUDIO}" "${WORKSPACE_PATH}" --args "${@}" + fi else echo "command ${STUDIO}" - "${STUDIO}" "${WORKSPACE_PATH}" "${@}" & + if [ "${ANDROID_STUDIO_DISABLE_OPEN_WORKSPACE}" = "true" ] + then + "${STUDIO}" "${@}" & + else + "${STUDIO}" "${WORKSPACE_PATH}" "${@}" & + fi fi } diff --git a/scripts/src/main/resources/scripts/command/intellij b/scripts/src/main/resources/scripts/command/intellij index 042f6b0bc..a8f1a9acd 100755 --- a/scripts/src/main/resources/scripts/command/intellij +++ b/scripts/src/main/resources/scripts/command/intellij @@ -149,10 +149,21 @@ function doStartIntellij() { if doIsMacOs then echo "MacOs command ${IDEA}" - open -na "${IDEA}" "${WORKSPACE_PATH}" --args "${@}" + if [ "${INTELLIJ_DISABLE_OPEN_WORKSPACE}" = "true" ] + then + open "${IDEA}" --args "${@}" + else + open -na "${IDEA}" "${WORKSPACE_PATH}" --args "${@}" + fi + else echo "command ${IDEA}" - "${IDEA}" "${WORKSPACE_PATH}" "${@}" & + if [ "${INTELLIJ_DISABLE_OPEN_WORKSPACE}" = "true" ] + then + "${IDEA}" "${@}" & + else + "${IDEA}" "${WORKSPACE_PATH}" "${@}" & + fi fi }