From 7cad65a1e707c73f594e1ae8cf9c75b609f177c5 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Wed, 23 Dec 2015 09:28:28 -0500 Subject: [PATCH] Remove which dependency from startup scripts --- compiler/cli/bin/kotlin | 5 ++++- compiler/cli/bin/kotlinc-js | 5 ++++- compiler/cli/bin/kotlinc-jvm | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/compiler/cli/bin/kotlin b/compiler/cli/bin/kotlin index a02490d0eb2..be74fceb354 100755 --- a/compiler/cli/bin/kotlin +++ b/compiler/cli/bin/kotlin @@ -16,4 +16,7 @@ export KOTLIN_RUNNER=1 -"$(dirname "$(which "$0")")"/kotlinc "$@" +DIR="${BASH_SOURCE[0]%/*}" +: ${DIR:="."} + +"${DIR}"/kotlinc "$@" diff --git a/compiler/cli/bin/kotlinc-js b/compiler/cli/bin/kotlinc-js index 3f66a7c8cd4..97b1f31171d 100755 --- a/compiler/cli/bin/kotlinc-js +++ b/compiler/cli/bin/kotlinc-js @@ -16,4 +16,7 @@ export KOTLIN_COMPILER=org.jetbrains.kotlin.cli.js.K2JSCompiler -"$(dirname "$(which "$0")")"/kotlinc "$@" +DIR="${BASH_SOURCE[0]%/*}" +: ${DIR:="."} + +"${DIR}"/kotlinc "$@" diff --git a/compiler/cli/bin/kotlinc-jvm b/compiler/cli/bin/kotlinc-jvm index d8e823a634c..5c4bb0e1949 100755 --- a/compiler/cli/bin/kotlinc-jvm +++ b/compiler/cli/bin/kotlinc-jvm @@ -14,4 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"$(dirname "$(which "$0")")"/kotlinc "$@" +DIR="${BASH_SOURCE[0]%/*}" +: ${DIR:="."} + +"${DIR}"/kotlinc "$@"