mirror of
https://github.com/cmderdev/cmder.git
synced 2025-04-24 02:22:32 +08:00
switch file hashes from MD5 to SHA256
This commit is contained in:
parent
bee82d00e8
commit
aa2eaa6886
@ -53,6 +53,6 @@ $version = Invoke-Expression "git describe --abbrev=0 --tags"
|
|||||||
|
|
||||||
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)")
|
$hash = (Digest-Hash "$saveTo\$($t.Name)")
|
||||||
Add-Content "$saveTo\hashes.txt" $hash
|
Add-Content "$saveTo\hashes.txt" $hash
|
||||||
}
|
}
|
@ -54,9 +54,9 @@ function Flatten-Directory ($name) {
|
|||||||
Remove-Item -Recurse "$($name)_moving"
|
Remove-Item -Recurse "$($name)_moving"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Digest-MD5 ($path) {
|
function Digest-Hash($path) {
|
||||||
if(Get-Command Get-FileHash -ErrorAction SilentlyContinue){
|
if(Get-Command Get-FileHash -ErrorAction SilentlyContinue){
|
||||||
return (Get-FileHash -Algorithm MD5 -Path $path).Hash
|
return (Get-FileHash -Algorithm SHA256 -Path $path).Hash
|
||||||
}
|
}
|
||||||
|
|
||||||
return Invoke-Expression "md5sum $path"
|
return Invoke-Expression "md5sum $path"
|
||||||
@ -76,7 +76,7 @@ function Register-Cmder(){
|
|||||||
$Command = "%V"
|
$Command = "%V"
|
||||||
|
|
||||||
, # Defaults to the icons folder in the cmder package.
|
, # Defaults to the icons folder in the cmder package.
|
||||||
$icon = (Split-Path $PathToExe | join-path -ChildPath 'icons/cmder.ico')
|
$icon = (Split-Path $PathToExe | Join-Path -ChildPath 'icons/cmder.ico')
|
||||||
)
|
)
|
||||||
Begin
|
Begin
|
||||||
{
|
{
|
||||||
@ -124,9 +124,9 @@ function Download-File {
|
|||||||
# I think this is the problem
|
# I think this is the problem
|
||||||
$File = $File -Replace "/", "\"
|
$File = $File -Replace "/", "\"
|
||||||
Write-Verbose "Downloading from $Url to $File"
|
Write-Verbose "Downloading from $Url to $File"
|
||||||
$wc = new-object System.Net.WebClient
|
$wc = New-Object System.Net.WebClient
|
||||||
if ($env:https_proxy) {
|
if ($env:https_proxy) {
|
||||||
$wc.proxy = (new-object System.Net.WebProxy($env:https_proxy))
|
$wc.proxy = (New-Object System.Net.WebProxy($env:https_proxy))
|
||||||
}
|
}
|
||||||
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
|
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
|
||||||
$wc.DownloadFile($Url, $File)
|
$wc.DownloadFile($Url, $File)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user