Skip to content

Commit 5ec58f6

Browse files
committed
fix dirname usage
1 parent 9f5f564 commit 5ec58f6

11 files changed

+29
-29
lines changed

dist/debug_adapter_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_linux.sh org.javacs.debug.JavaDebugServer $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_linux.sh org.javacs.debug.JavaDebugServer $@

dist/debug_adapter_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_mac.sh org.javacs.debug.JavaDebugServer $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_mac.sh org.javacs.debug.JavaDebugServer $@

dist/debug_adapter_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_windows.sh org.javacs.debug.JavaDebugServer $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_windows.sh org.javacs.debug.JavaDebugServer $@

dist/java-debug-server

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ OS="unknown"
44
if which -s uname;then
55
OS=$(uname |tr '[:upper:]' '[:lower:]')
66
fi
7-
SCRIPTS_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
7+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
88
if [[ "${OS}" == 'darwin' ]]; then
9-
${SCRIPTS_DIR}/debug_adapter_mac.sh $@
9+
${DIST_DIR}/debug_adapter_mac.sh $@
1010
elif [[ "${OS}" == 'linux' ]]; then
11-
${SCRIPTS_DIR}/debug_adapter_linux.sh $@
11+
${DIST_DIR}/debug_adapter_linux.sh $@
1212
else
13-
${SCRIPTS_DIR}/debug_adapter_windows.sh $@
13+
${DIST_DIR}/debug_adapter_windows.sh $@
1414
fi

dist/java-language-server

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ OS="unknown"
44
if which -s uname;then
55
OS=$(uname |tr '[:upper:]' '[:lower:]')
66
fi
7-
SCRIPTS_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
7+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
88
if [[ "${OS}" == 'darwin' ]]; then
9-
${SCRIPTS_DIR}/lang_server_mac.sh $@
9+
${DIST_DIR}/lang_server_mac.sh $@
1010
elif [[ "${OS}" == 'linux' ]]; then
11-
${SCRIPTS_DIR}/lang_server_linux.sh $@
11+
${DIST_DIR}/lang_server_linux.sh $@
1212
else
13-
${SCRIPTS_DIR}/lang_server_windows.sh $@
13+
${DIST_DIR}/lang_server_windows.sh $@
1414
fi

dist/lang_server_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_linux.sh org.javacs.Main $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_linux.sh org.javacs.Main $@

dist/lang_server_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_mac.sh org.javacs.Main $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_mac.sh org.javacs.Main $@

dist/lang_server_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
2-
DIR=`dirname $0`
3-
$DIR/launch_windows.sh org.javacs.Main $@
2+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
3+
${DIST_DIR}/launch_windows.sh org.javacs.Main $@

dist/launch_linux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ JLINK_VM_OPTIONS="\
88
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
99
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
1010
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
11-
DIR=`dirname $0`
12-
CLASSPATH_OPTIONS="-classpath $DIR/classpath/gson-2.8.9.jar:$DIR/classpath/protobuf-java-3.19.3.jar:$DIR/classpath/java-language-server.jar"
13-
$DIR/linux/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@
11+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
12+
CLASSPATH_OPTIONS="-classpath ${DIST_DIR}/classpath/gson-2.8.9.jar:${DIST_DIR}/classpath/protobuf-java-3.19.3.jar:${DIST_DIR}/classpath/java-language-server.jar"
13+
${DIST_DIR}/linux/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@

dist/launch_mac.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ JLINK_VM_OPTIONS="\
88
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
99
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
1010
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
11-
DIR=`dirname $0`
12-
CLASSPATH_OPTIONS="-classpath $DIR/classpath/gson-2.8.9.jar:$DIR/classpath/protobuf-java-3.19.3.jar:$DIR/classpath/java-language-server.jar"
13-
$DIR/mac/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@
11+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
12+
CLASSPATH_OPTIONS="-classpath ${DIST_DIR}/classpath/gson-2.8.9.jar:${DIST_DIR}/classpath/protobuf-java-3.19.3.jar:${DIST_DIR}/classpath/java-language-server.jar"
13+
${DIST_DIR}/mac/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@

dist/launch_windows.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ JLINK_VM_OPTIONS="\
88
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
99
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
1010
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
11-
DIR=`dirname $0`
12-
CLASSPATH_OPTIONS="-classpath $DIR/classpath/gson-2.8.9.jar;$DIR/classpath/protobuf-java-3.19.3.jar;$DIR/classpath/java-language-server.jar"
13-
$DIR/windows/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@
11+
DIST_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
12+
CLASSPATH_OPTIONS="-classpath ${DIST_DIR}/classpath/gson-2.8.9.jar;${DIST_DIR}/classpath/protobuf-java-3.19.3.jar;${DIST_DIR}/classpath/java-language-server.jar"
13+
${DIST_DIR}/windows/bin/java $JLINK_VM_OPTIONS $CLASSPATH_OPTIONS $@

0 commit comments

Comments
 (0)