Browse Source

Remove old IPFS pin

improve-ipfs
Silke 1 month ago
parent
commit
6d86b3ea9f
  1. 16
      deploy.sh

16
deploy.sh

@ -24,6 +24,10 @@ then
IPFS_ARGS+=("--api=${IPFS_API}")
fi
_ipfs() {
ipfs "${IPFS_ARGS[@]}" "$@"
}
for arg in "$@"
do
echo "Step: ${arg}"
@ -32,8 +36,16 @@ do
hugo "${HUGO_ARGS[@]}"
;;
ipfs)
ipfs "${IPFS_ARGS[@]}" add -qr public/ | tee ipfs.log
ipfs "${IPFS_ARGS[@]}" name publish "/ipfs/$(tail -n1 ipfs.log)"
id="$(_ipfs id -f"<id>")"
cur="$(_ipfs name resolve "/ipns/${id}")"
new="/ipfs/$(_ipfs add -Qr public/)"
if [ "${cur}" == "${new}" ]
then
echo "Already published: ${new}"
else
_ipfs name publish "${new}"
_ipfs pin rm "${cur}"
fi
;;
esac
done

Loading…
Cancel
Save