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.
This commit is contained in:
PChemGuy 2025-03-14 14:29:37 +03:00
parent 4971619b69
commit df9a413ef8

View File

@ -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