Refactor manipulation of nextcloud sync file
This commit is contained in:
parent
0a7851fabe
commit
d85cea9cb2
1 changed files with 14 additions and 3 deletions
|
@ -244,13 +244,24 @@ class Context {
|
||||||
$configName += "WithPlaceholders";
|
$configName += "WithPlaceholders";
|
||||||
}
|
}
|
||||||
|
|
||||||
Add-Content $($this.GetNextcloudConfigFile()) `
|
$accountSectionEntered = $false;
|
||||||
-Value (
|
|
||||||
|
Get-Content $($this.GetNextcloudConfigFile()) | `
|
||||||
|
ForEach-Object {
|
||||||
|
if ($_ -eq "[Accounts]") {
|
||||||
|
$accountSectionEntered = $true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_ -eq "" -and $accountSectionEntered) {
|
||||||
[string]::Join(
|
[string]::Join(
|
||||||
"`n",
|
"`n",
|
||||||
@(
|
@(
|
||||||
"0\$configName\$folderID\localPath=$localPath",
|
"0\$configName\$folderID\localPath=$localPath",
|
||||||
"0\$configName\$folderID\targetPath=$targetPath")));
|
"0\$configName\$folderID\targetPath=$targetPath"));
|
||||||
|
}
|
||||||
|
|
||||||
|
$_;
|
||||||
|
} | Set-Content $this.GetNextcloudConfigFile();
|
||||||
|
|
||||||
Start-Process $nextcloudPath;
|
Start-Process $nextcloudPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue