mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Computing hashes
This commit is contained in:
parent
db49c14422
commit
b9379b3ae2
@ -32,7 +32,7 @@ Param(
|
|||||||
[string]$cmderRoot = "..",
|
[string]$cmderRoot = "..",
|
||||||
|
|
||||||
# Vendor folder locaton
|
# Vendor folder locaton
|
||||||
[string]$saveTo = "."
|
[string]$saveTo = "..\build"
|
||||||
)
|
)
|
||||||
|
|
||||||
. "$PSScriptRoot\utils.ps1"
|
. "$PSScriptRoot\utils.ps1"
|
||||||
@ -41,12 +41,16 @@ $ErrorActionPreference = "Stop"
|
|||||||
$targets = @{
|
$targets = @{
|
||||||
"cmder.zip" = $null;
|
"cmder.zip" = $null;
|
||||||
"cmder.7z" = $null;
|
"cmder.7z" = $null;
|
||||||
"cmder_mini.zip" = "-x!`"..\vendor\msysgit`"";
|
"cmder_mini.zip" = "-x!`"vendor\msysgit`"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Delete-Existing "..\Version*"
|
||||||
|
|
||||||
$version = Invoke-Expression "git describe --abbrev=0 --tags"
|
$version = Invoke-Expression "git describe --abbrev=0 --tags"
|
||||||
New-Item -ItemType file "$cmderRoot\Version $version"
|
New-Item -ItemType file "$cmderRoot\Version $version"
|
||||||
|
|
||||||
foreach ($t in $targets.GetEnumerator()) {
|
foreach ($t in $targets.GetEnumerator()) {
|
||||||
Create-Archive $cmderRoot "$saveTo\$($t.Name)" $t.Value
|
Create-Archive $cmderRoot "$saveTo\$($t.Name)" $t.Value
|
||||||
|
$hash = (Digest-MD5 "$saveTo\$($t.Name)")
|
||||||
|
Add-Content "$saveTo\hashes.txt" $hash
|
||||||
}
|
}
|
@ -43,3 +43,7 @@ function Flatten-Directory ($name) {
|
|||||||
Move-Item -Path "$($name)_moving\$child" -Destination $name
|
Move-Item -Path "$($name)_moving\$child" -Destination $name
|
||||||
Remove-Item -Recurse "$($name)_moving"
|
Remove-Item -Recurse "$($name)_moving"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Digest-MD5 ($path) {
|
||||||
|
return Invoke-Expression "md5sum $path"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user