From 8fc78e1c2d917e5d4809f4734da9802ce6876ff8 Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Thu, 16 Nov 2023 22:14:23 +0000 Subject: [PATCH] debug --- update_directory_hashes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update_directory_hashes.sh b/update_directory_hashes.sh index dba0634..c150f44 100755 --- a/update_directory_hashes.sh +++ b/update_directory_hashes.sh @@ -16,12 +16,13 @@ if test -z "$vanity_text" -o "$vanity_text" = "-h" -o "$vanity_text" = "--help"; fi # TODO: use ipfs dag get instead of ipfs object get +touch "$directory/directory_hashes.js" partial_hash="$(ipfs add --ignore-rules-path "$directory/.ipfsignore" --pin=false --hidden -Qr "$directory")" foo="$(ipfs object get "$partial_hash" | jq '.Links |= map(if .Name == "directory_hashes.js" then { "Name": .Name, "Hash": "", "Size": 0 } else . end)' )" write_directory_hashes() { contents="$(printf %s "$foo" | jq -r '{vanity_text:"'"$vanity_text"'", vanity_number:'$1',tree:.} | tostring')" - printf 'jsonp_ipfs_directory_hashes(%s);\n' "$contents" > "$directory"/directory_hashes.js + printf 'jsonp_ipfs_directory_hashes(%s);\n' "$contents" > "$directory/directory_hashes.js" } write_directory_hashes "0"