@@ -27,19 +27,26 @@ NODE_ENV=production OPENSCAN_COMMIT_HASH=$COMMIT_HASH npm run build
2727echo " Production build completed!"
2828echo " Build output is in ./dist/"
2929
30- # Get IPFS hash (ensure consistent chunking)
31- ipfs add -r --chunker=size-262144 --raw-leaves=false ./dist
32- HASH=$( ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
33- HASH_V1=$( ipfs cid format -v 1 -b base32 $HASH )
34-
35- echo " IPFS Hash (v0): $HASH "
36- echo " IPFS Hash (v1): $HASH_V1 "
37- echo " "
38- echo " IPFS URLs:"
39- echo " - https://ipfs.io/ipfs/$HASH "
40- echo " - https://cloudflare-ipfs.com/ipfs/$HASH "
41- echo " - https://gateway.ipfs.io/ipfs/$HASH "
42- echo " "
43- echo " IPFS v1 URLs:"
44- echo " - https://$HASH_V1 .ipfs.dweb.link"
45- echo " - https://$HASH_V1 .ipfs.cf-ipfs.com"
30+ # Generate IPFS hash if ipfs CLI (Kubo) is available
31+ if command -v ipfs & > /dev/null; then
32+ echo " "
33+ echo " Generating IPFS hash..."
34+ HASH=$( ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
35+ HASH_V1=$( ipfs cid format -v 1 -b base32 $HASH )
36+
37+ echo " IPFS Hash (v0): $HASH "
38+ echo " IPFS Hash (v1): $HASH_V1 "
39+ echo " "
40+ echo " IPFS URLs:"
41+ echo " - https://ipfs.io/ipfs/$HASH "
42+ echo " - https://cloudflare-ipfs.com/ipfs/$HASH "
43+ echo " - https://gateway.ipfs.io/ipfs/$HASH "
44+ echo " "
45+ echo " IPFS v1 URLs:"
46+ echo " - https://$HASH_V1 .ipfs.dweb.link"
47+ echo " - https://$HASH_V1 .ipfs.cf-ipfs.com"
48+ else
49+ echo " "
50+ echo " IPFS CLI (Kubo) not found. Skipping hash generation."
51+ echo " Install Kubo to generate IPFS hashes: https://docs.ipfs.tech/install/"
52+ fi
0 commit comments