mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	Initial git cleanup PS
It's not functional, yet.
This commit is contained in:
		| @@ -16,7 +16,7 @@ | |||||||
|     Creates default archives for cmder with plenty of information |     Creates default archives for cmder with plenty of information | ||||||
| .NOTES | .NOTES | ||||||
|     AUTHORS |     AUTHORS | ||||||
|     Samuel Vasko, Jack Bennett |     Samuel Vasko, Jack Bennett, Martin Kemp | ||||||
|     Part of the Cmder project. |     Part of the Cmder project. | ||||||
| .LINK | .LINK | ||||||
|     https://github.com/bliker/cmder - Project Home |     https://github.com/bliker/cmder - Project Home | ||||||
| @@ -46,6 +46,7 @@ $targets = @{ | |||||||
| } | } | ||||||
|  |  | ||||||
| Delete-Existing "..\Version*" | Delete-Existing "..\Version*" | ||||||
|  | Cleanup-Git | ||||||
|  |  | ||||||
| $version = Invoke-Expression "git describe --abbrev=0 --tags" | $version = Invoke-Expression "git describe --abbrev=0 --tags" | ||||||
| (New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null | (New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null | ||||||
|   | |||||||
| @@ -56,3 +56,13 @@ function Flatten-Directory ($name) { | |||||||
| function Digest-MD5 ($path) { | function Digest-MD5 ($path) { | ||||||
|     return Invoke-Expression "md5sum $path" |     return Invoke-Expression "md5sum $path" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function Cleanup-Git () { | ||||||
|  |     $gitdir = '/vendor/msysgit/libexec/git-core/' | ||||||
|  |     Get-Childitem $gitdir -Filter git-* | Where { $_ -NotMatch '--' } | Foreach-Object { | ||||||
|  |         '@' + $_.BaseName.Split("-") -join ' ' + ' $*' | Set-Content -Path $_.BaseName'.bat' | ||||||
|  |         Remove-Item $_.FullName | ||||||
|  |     } | ||||||
|  |     # Cleanup any missed files | ||||||
|  |     Get-Childitem $gitdir -Exclude git.exe,*.bat | Where-Object{!($_.PSIsContainer)} | Foreach-Object { Remove-Item $_.FullName } | ||||||
|  | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user