Print debug info about Nextcloud sync

This commit is contained in:
Manuel Thalmann 2023-07-25 10:51:16 +02:00
parent 87d99f8ede
commit 7ba8fb50b2

View file

@ -248,6 +248,8 @@ class Context {
}
[void] AddNextcloudSync([string] $localPath, [string] $targetPath, [bool] $virtualFiles) {
Write-Host "Adding a Nextcloud sync";
Write-Information "$targetPath <=> $localPath";
$pattern = "^\d+\\Folders(?:WithPlaceholders)?\\(\d+)";
$folderID = (
@ -265,6 +267,7 @@ class Context {
$configName += "WithPlaceholders";
}
Write-Information "Stopping Nextcloud process";
$nextcloudProcess = Get-Process nextcloud;
$nextcloudPath = [string]$nextcloudProcess[0].Path;
$nextcloudProcess | Stop-Process -Force;
@ -288,6 +291,10 @@ class Context {
$_;
} | Set-Content $this.GetNextcloudConfigFile();
Write-Information "New nextcloud config:";
Write-Information Get-Content $($this.GetNextcloudConfigFile());
Write-Information "Restarting Nextcloud";
Start-Process $nextcloudPath;
}