From 20d037b1e8d46769d12df199962296be80960c0b Mon Sep 17 00:00:00 2001 From: itsscb Date: Wed, 16 Apr 2025 13:29:13 +0200 Subject: [PATCH] feat: add paranoid check --- Start-FileBrowser.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Start-FileBrowser.ps1 b/Start-FileBrowser.ps1 index cd6b447..9cdd2dd 100644 --- a/Start-FileBrowser.ps1 +++ b/Start-FileBrowser.ps1 @@ -124,6 +124,7 @@ begin "recaptcha": null } }' + $app_dir = Join-Path $env:PROGRAMDATA 'filebrowser' if(-not (Test-Path $app_dir -PathType Container)) { @@ -142,12 +143,14 @@ begin } } + if(-not (Test-Path $filebrowser_exe -PathType Leaf)) + { + throw "filebrowser.exe is missing" + } + Set-Alias 'filebrowser' $filebrowser_exe $config_path = Join-Path $app_dir 'config.json' - # if(-not (Test-Path $config_path -PathType Leaf)) - # { $config_json > $config_path - # } $db_path = Join-Path $app_dir "filebrowser.db" if(Test-Path $db_path -PathType Leaf)