From ce3fbf3ae80ee49fd9500ebea8c7362e65886920 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Tue, 25 Jun 2024 18:04:13 +0900 Subject: [PATCH] msi: refactor fluentd.bat * Remove unnecessary enabledelayedexpansion * Remove unnecessary `/` * Make FLUENT_PACKAGE_VERSION local Signed-off-by: Daijiro Fukuda --- fluent-package/msi/assets/fluentd.bat | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fluent-package/msi/assets/fluentd.bat b/fluent-package/msi/assets/fluentd.bat index d3ca83a87..061497626 100644 --- a/fluent-package/msi/assets/fluentd.bat +++ b/fluent-package/msi/assets/fluentd.bat @@ -6,21 +6,23 @@ if "%~nx0" == "td-agent.bat" ( ) @rem Convert path separator from backslash to forwardslash -setlocal enabledelayedexpansion -set FLUENT_PACKAGE_TOPDIR=!FLUENT_PACKAGE_TOPDIR:\=/! +set FLUENT_PACKAGE_TOPDIR=%FLUENT_PACKAGE_TOPDIR:\=/% set PATH=%FLUENT_PACKAGE_TOPDIR%bin;%PATH% set PATH=%FLUENT_PACKAGE_TOPDIR%;%PATH% -set "FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/fluentd.conf" -set "FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/plugin" -set "FLUENT_PACKAGE_VERSION=%FLUENT_PACKAGE_TOPDIR%/bin/fluent-package-version.rb" +set "FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%etc/fluent/fluentd.conf" +set "FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%etc/fluent/plugin" + +setlocal +set "FLUENT_PACKAGE_VERSION=%FLUENT_PACKAGE_TOPDIR%bin/fluent-package-version.rb" for %%p in (%*) do ( if "%%p"=="--version" ( ruby "%FLUENT_PACKAGE_VERSION%" goto last ) ) -"%FLUENT_PACKAGE_TOPDIR%/bin/fluentd" %* endlocal +"%FLUENT_PACKAGE_TOPDIR%bin/fluentd" %* + :last