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

pretty print the sha256 hash generated by hash-cd #198

Merged
merged 1 commit into from
Apr 5, 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
11 changes: 8 additions & 3 deletions script/hash-cd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ set -euo pipefail
TMP_DIR=$(mktemp --directory)
trap 'rm -rf -- "$TMP_DIR"' EXIT

info "calculating hash of CD in \"$CD_DEV\""
HASH=$(cd_sha256 "$CD_DEV" "$TMP_DIR")
info "CD in \"$CD_DEV\" has hash \"sha256-$HASH\""
info "calculating digest of CD in \"$CD_DEV\""
HASH=$(
cd_sha256 "$CD_DEV" "$TMP_DIR" \
| awk '{gsub(/.{2}/,"& ")}1' \
| sed 's/ /\n/8;P;D' \
| head -c -1
)
info "CD in \"$CD_DEV\" has sha256 digest:\n$HASH"
2 changes: 1 addition & 1 deletion script/oks-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error() {
}

info() {
command echo ["$(date --utc +%FT%TZ)" INFO "${0##*/}"] "$@"
command echo -e ["$(date --utc +%FT%TZ)" INFO "${0##*/}"] "$@"
}

# check that a given command is on PATH, if not exit 1
Expand Down
Loading