1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-09-21 05:42:46 +02:00
TweetDuck/Resources/PostBuild.ps1

13 lines
449 B
PowerShell

Param([Parameter(Mandatory = $True, Position = 1)][string] $dir)
$ErrorActionPreference = "Stop"
Set-Location $dir
ForEach($file in Get-ChildItem -Include *.js, *.html -Recurse){
$lines = Get-Content -Path $file.FullName
$lines = ($lines | % { $_.TrimStart() }) -Replace '^(.*?)((?<=^|[;{}()] )//\s.*)?$', '$1'
$lines | Where { $_ -ne '' } | Set-Content -Path $file.FullName
Write-Host "Processed" $file.FullName.Substring($dir.Length)
}