Commit 59c35fac authored by Tomáš Hübelbauer's avatar Tomáš Hübelbauer

Extend to cover any Office files

parent 6f08c86b
Copy-Item Title.docx
Expand-Archive -DestinationPath out/Title -Force
# Format XML files
Get-ChildItem out/Title -Filter *.xml -Recurse |
Foreach-Object {
$path = $_.FullName
$xml = [xml](Get-Content -literalPath $path)
git add "$path"
# Iterate Office files in the repository
Get-ChildItem .\* -Include ("*.docx", "*.xlsx", "*.pptx") -Recurse |
Foreach-Object {
$officePath = $_.FullName
Write-Output "Extracting $officePath"
Copy-Item $officePath "$"
Expand-Archive "$" -DestinationPath "$officePath.git" -Force
Remove-Item "$"
# Format XML files for nice diff
Get-ChildItem "$officePath.git" -Filter *.xml -Recurse |
Foreach-Object {
$xmlPath = $_.FullName
Write-Output "Formatting $xmlPath"
([xml](Get-Content -literalPath $xmlPath)).Save($xmlPath)
Write-Output "Tracking $xmlPath"
git add "$xmlPath"
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