From df9a413ef836f6dccbf9eaf9bfccff859b2b98e7 Mon Sep 17 00:00:00 2001 From: PChemGuy <39730837+pchemguy@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:29:37 +0300 Subject: [PATCH] Strip trailing backslash %~dp0 always contains a trailing backslash. The way %DIR% is used in the following line, the trailing slash should be stripped. Alternatively, `%DIR%\\` may be replaced with `%DIR%`, but I would advice against. It is ok to have `%~dp0trilium-data`, which is a conventional pattern. Once %~dp0 is replaced with %DIR% (which is not really warranted here), stripping the trailing slash right after assignment is preferable. --- bin/tpl/trilium-portable.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/tpl/trilium-portable.bat b/bin/tpl/trilium-portable.bat index ab07e2cd9..b6eeb853f 100644 --- a/bin/tpl/trilium-portable.bat +++ b/bin/tpl/trilium-portable.bat @@ -15,6 +15,7 @@ chcp 65001 :: Get Current Trilium executable directory and compute data directory SET DIR=%~dp0 +SET DIR=%DIR:~0,-1% SET TRILIUM_DATA_DIR=%DIR%\trilium-data cd "%DIR%" start trilium.exe