-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.ps1
More file actions
28 lines (19 loc) · 790 Bytes
/
sync.ps1
File metadata and controls
28 lines (19 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
Push-Location $dir
$sourceRoot = "_site"
$destinationRoot = "..\AximoGames-pages\docs\"
Remove-Item -Recurse -Force $destinationRoot
Copy-Item -Path $sourceRoot -Recurse -Destination $destinationRoot -Container
$sourceRoot = "..\AximoGames-pages\docs-base\*"
$destinationRoot = "..\AximoGames-pages\docs\"
Copy-Item -Path $sourceRoot -Recurse -Destination $destinationRoot -Container
[RegEx]$Search = '(index\.html)"'
$Replace = '"'
[RegEx]$Search2 = '(\.html)"'
$Replace2 = '"'
ForEach ($File in (Get-ChildItem -Path $destinationRoot -Filter *.html -Recurse -File)) {
(Get-Content $File.FullName) -Replace $Search,$Replace -Replace $Search2,$Replace2 |
Set-Content $File.FullName
}
Pop-Location