From 26e70c059395e6654ba08cf1702af35126ae818d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Sun, 10 Dec 2023 13:24:48 +0000 Subject: [PATCH] Make ktlint.bat usable --- ktlint-cli/src/main/scripts/ktlint.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ktlint-cli/src/main/scripts/ktlint.bat b/ktlint-cli/src/main/scripts/ktlint.bat index 55467be651..e9ef9f5578 100644 --- a/ktlint-cli/src/main/scripts/ktlint.bat +++ b/ktlint-cli/src/main/scripts/ktlint.bat @@ -1,8 +1,10 @@ @echo off +setlocal + REM By default this batch file and the "ktlint" are located in same directory. Note that "ktlint" is a JAR REM despite it is not being suffixed with extension ".jar". Please adjust path below when this batch file REM and the jar file are located in different directories. -if not defined JAR_PATH set JAR_PATH=.\ktlint +if not defined JAR_PATH set JAR_PATH=%~dp0ktlint REM The --add-opens argument is needed for java 16+ (see https://github.com/pinterest/ktlint/issues/1986) java --add-opens=java.base/java.lang=ALL-UNNAMED -jar "%JAR_PATH%" %*