Kill Nextcloud while editing config

This commit is contained in:
Manuel Thalmann 2023-07-02 17:38:44 +02:00
parent 8d28171c6c
commit a5bf93f5ed

View file

@ -224,7 +224,10 @@ class Context {
}
[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 = (
Get-Content $($this.GetNextcloudConfigFile()) | `
@ -243,6 +246,8 @@ class Context {
@(
"0\$configName\$folderID\localPath=$localPath",
"0\$configName\$folderID\targetPath=$targetPath"));
Start-Process $nextcloudPath;
}
[void] Reboot() {