Commit 9e657baf authored by Tomáš Hübelbauer's avatar Tomáš Hübelbauer

Generate text-only files for lossy diff

parent 142cdbae
......@@ -14,7 +14,19 @@ Get-ChildItem .\* -Include ("*.docx", "*.xlsx", "*.pptx") -Recurse |
$xmlPath = $_.FullName
Write-Output "Formatting $xmlPath"
([xml](Get-Content -literalPath $xmlPath)).Save($xmlPath)
$xml = ([xml](Get-Content -literalPath $xmlPath))
$xml.Save($xmlPath)
# Export only text nodes for text-only lossy diff
$txt = ""
$nodes = $xml.SelectNodes("//text()")
foreach ($node in $nodes) {
$txt += $node.Value + "`n"
}
$txtPath = "$xmlPath.txt"
Write-Output "Generating $txtPath"
$txt | Out-File -literalPath $txtPath
}
Write-Output "Tracking $officePath.git"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment