Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Add powershell equivalents to existing batch scripts (#2561)
U-Bren780b52050676
diff --git a/bin/build-win-x64.sh b/bin/build-win-x64.shindex 68ce53001c..c1b8030e49 100755--- a/bin/build-win-x64.sh+++ b/bin/build-win-x64.sh@@ -27,9 +27,7 @@ rm -r $BUILD_DIR/swiftshadercp bin/tpl/anonymize-database.sql $BUILD_DIR/-cp bin/tpl/trilium-portable.bat $BUILD_DIR/-cp bin/tpl/trilium-no-cert-check.bat $BUILD_DIR/-cp bin/tpl/trilium-safe-mode.bat $BUILD_DIR/+cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.{bat,ps1} $BUILD_DIR/echo "Zipping windows x64 electron distribution..."VERSION=`jq -r ".version" package.json`diff --git a/bin/tpl/trilium-no-cert-check.bat b/bin/tpl/trilium-no-cert-check.batindex e10fa90aca..01a3766850 100644--- a/bin/tpl/trilium-no-cert-check.bat+++ b/bin/tpl/trilium-no-cert-check.bat@@ -1,4 +1,5 @@SET DIR=%~dp0set NODE_TLS_REJECT_UNAUTHORIZED=0cd %DIR%-start trilium.exe+WHERE powershell.exe+IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-no-cert-check.ps1)\ No newline at end of filediff --git a/bin/tpl/trilium-no-cert-check.ps1 b/bin/tpl/trilium-no-cert-check.ps1new file mode 100644index 0000000000..43ea010b99--- /dev/null+++ b/bin/tpl/trilium-no-cert-check.ps1@@ -0,0 +1,2 @@+Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0+./trilium.exe\ No newline at end of filediff --git a/bin/tpl/trilium-portable.bat b/bin/tpl/trilium-portable.batindex ac65555995..668872d038 100644--- a/bin/tpl/trilium-portable.bat+++ b/bin/tpl/trilium-portable.bat@@ -1,4 +1,5 @@SET DIR=%~dp0SET TRILIUM_DATA_DIR=%DIR%\trilium-datacd %DIR%-start trilium.exe\ No newline at end of file+WHERE powershell.exe+IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-portable.ps1)\ No newline at end of filediff --git a/bin/tpl/trilium-portable.ps1 b/bin/tpl/trilium-portable.ps1new file mode 100644index 0000000000..98bd36cb6d--- /dev/null+++ b/bin/tpl/trilium-portable.ps1@@ -0,0 +1,2 @@+Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'+./trilium.exe\ No newline at end of filediff --git a/bin/tpl/trilium-safe-mode.bat b/bin/tpl/trilium-safe-mode.batindex a40f03bd82..45fb21c07c 100644--- a/bin/tpl/trilium-safe-mode.bat+++ b/bin/tpl/trilium-safe-mode.bat@@ -1,4 +1,5 @@SET DIR=%~dp0SET TRILIUM_SAFE_MODE=1cd %DIR%-start trilium.exe+WHERE powershell.exe+IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-safe-mode.ps1)\ No newline at end of filediff --git a/bin/tpl/trilium-safe-mode.ps1 b/bin/tpl/trilium-safe-mode.ps1new file mode 100644index 0000000000..5fafd5c3e6--- /dev/null+++ b/bin/tpl/trilium-safe-mode.ps1@@ -0,0 +1,2 @@+Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1+./trilium.exe\ No newline at end of file