Kill Nextcloud while editing config

This commit is contained in:
Manuel Thalmann 2023-07-02 17:38:44 +02:00
parent 441399b90c
commit 0f39ccbfb6

View file

@ -224,7 +224,10 @@ class Context {
} }
[void] AddNextcloudSync([string] $localPath, [string] $targetPath, [bool] $virtualFiles) { [void] AddNextcloudSync([string] $localPath, [string] $targetPath, [bool] $virtualFiles) {
$pattern = "^\d+\\Folders(?:WithPlaceholders)?\\(\d+)" $pattern = "^\d+\\Folders(?:WithPlaceholders)?\\(\d+)";
$nextcloudProcess = Get-Process nextcloud;
$nextcloudPath = $nextcloudProcess.Path;
$nextcloudProcess | Stop-Process -Force;
$folderID = ( $folderID = (
Get-Content $($this.GetNextcloudConfigFile()) | ` Get-Content $($this.GetNextcloudConfigFile()) | `
@ -243,6 +246,8 @@ class Context {
@( @(
"0\$configName\$folderID\localPath=$localPath", "0\$configName\$folderID\localPath=$localPath",
"0\$configName\$folderID\targetPath=$targetPath")); "0\$configName\$folderID\targetPath=$targetPath"));
Start-Process $nextcloudPath;
} }
[void] Reboot() { [void] Reboot() {