Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hash computations #111

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: hustcer/[email protected]
with:
version: nightly
version: "0.100.0"

- name: Show Nushell Version
run: version
Expand Down
4 changes: 2 additions & 2 deletions nupm/utils/registry.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use dirs.nu cache-dir
use log.nu throw-error
use misc.nu [check-cols url hash-file]
use misc.nu [check-cols url hash-file hash-fn]

# Columns of a registry file
export const REG_COLS = [ name path hash ]
Expand Down Expand Up @@ -84,7 +84,7 @@ export def search-package [
http get $url | save --force $pkg_file_path
}

let new_hash = $pkg_file_path | hash-file
let new_hash = open $pkg_file_path | to nuon | hash-fn

if $new_hash != $row.hash {
throw-error ($'Content of package file ($pkg_file_path)'
Expand Down
5 changes: 0 additions & 5 deletions tests/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,3 @@ export def generate-local-registry [] {
assert equal $actual $expected
}
}

export def registry-files-no-newlines [] {
assert (ls tests/packages/registry/*nuon
| all { not (open $in.name --raw | str contains (char nl)) })
}
8 changes: 7 additions & 1 deletion tests/packages/registry/registry.nuon
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
[[name, path, hash]; [spam_custom, spam_custom.nuon, "md5-90c14f51108a3c067d1f1e11f156ca98"], [spam_module, spam_module.nuon, "md5-c14d7a703fb0e587cf19934c5a397619"], [spam_script, spam_script.nuon, "md5-d7724c6282cc7eb878178b79f8617e29"]]
[
[name, path, hash];

[spam_custom, spam_custom.nuon, "md5-7b3a5119d1af5a025dae32bcfc7cab96"],
[spam_module, spam_module.nuon, "md5-618c7c8ed97b423f111790d97bcd8486"],
[spam_script, spam_script.nuon, "md5-ce1b060a68ebb42291e364b5daa6d47a"],
]
Loading