From 4971619b696b368244d1b267b66acd0d3dd188e0 Mon Sep 17 00:00:00 2001 From: PChemGuy <39730837+pchemguy@users.noreply.github.com> Date: Fri, 14 Mar 2025 14:19:11 +0300 Subject: [PATCH 1/2] Missing quotes --- bin/tpl/trilium-no-cert-check.bat | 2 +- bin/tpl/trilium-portable.bat | 2 +- bin/tpl/trilium-safe-mode.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tpl/trilium-no-cert-check.bat b/bin/tpl/trilium-no-cert-check.bat index 360064bdc..cfc345c42 100644 --- a/bin/tpl/trilium-no-cert-check.bat +++ b/bin/tpl/trilium-no-cert-check.bat @@ -16,7 +16,7 @@ chcp 65001 :: Get Current Trilium executable directory and compute data directory SET DIR=%~dp0 set NODE_TLS_REJECT_UNAUTHORIZED=0 -cd %DIR% +cd "%DIR%" start trilium.exe GOTO END diff --git a/bin/tpl/trilium-portable.bat b/bin/tpl/trilium-portable.bat index a89476ae0..ab07e2cd9 100644 --- a/bin/tpl/trilium-portable.bat +++ b/bin/tpl/trilium-portable.bat @@ -16,7 +16,7 @@ chcp 65001 :: Get Current Trilium executable directory and compute data directory SET DIR=%~dp0 SET TRILIUM_DATA_DIR=%DIR%\trilium-data -cd %DIR% +cd "%DIR%" start trilium.exe GOTO END diff --git a/bin/tpl/trilium-safe-mode.bat b/bin/tpl/trilium-safe-mode.bat index 7692ec7dc..7e0fafa99 100644 --- a/bin/tpl/trilium-safe-mode.bat +++ b/bin/tpl/trilium-safe-mode.bat @@ -16,7 +16,7 @@ chcp 65001 :: Get Current Trilium executable directory and compute data directory SET DIR=%~dp0 SET TRILIUM_SAFE_MODE=1 -cd %DIR% +cd "%DIR%" start trilium.exe --disable-gpu GOTO END 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 2/2] 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