diff options
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | stashley | 25 |
2 files changed, 14 insertions, 13 deletions
@@ -6,6 +6,7 @@ The format for files is as follows: ``` name=PersonalityName +IPFS=true [socialMedia] urls=["example.com", "example.org"] @@ -15,6 +16,7 @@ A filled example is as follows: ``` name="Sashley" +IPFS=true [toyhouse] urls=["https://toyhou.se/sashley/art"] @@ -1,7 +1,7 @@ #!/bin/sh tomlq -r '.|keys_unsorted[]' "$1" | while IFS= read -r site; do - if [ "$site" != "name" ] + if [ "$site" != "name" ] && [ "$site" != "IPFS" ] then tomlq -r ".$site.urls[]" "$1" | while IFS= read -r url; do @@ -24,18 +24,17 @@ done fdupes -dIr . -ipfs --help || exit 0 - -if [ "$(ipfs --help)" = 0 ] +if [ "$(tomlq -r '.IPFS' "$1")" = "true" ] then - ## Add new content to personality-archive - personalityName=$(tomlq -r '.name' "$1") - ipfs files mkdir /personality-archive - personalityHash=$(ipfs add -Q -r .) - ipfs files rm -r /personality-archive/"$personalityName" - ipfs files cp /ipfs/"$personalityHash" /personality-archive/"$personalityName" - ## Update IPNS with new personality-archive - personalityArchiveLocationHash=$(ipfs files stat --hash /personality-archive) - ipfs name publish "$personalityArchiveLocationHash" +## Add new content to personality-archive +personalityName=$(tomlq -r '.name' "$1") +ipfs files mkdir /personality-archive +personalityHash=$(ipfs add -Q -r .) +ipfs files rm -r /personality-archive/"$personalityName" +ipfs files cp /ipfs/"$personalityHash" /personality-archive/"$personalityName" + +## Update IPNS with new personality-archive +personalityArchiveLocationHash=$(ipfs files stat --hash /personality-archive) +ipfs name publish "$personalityArchiveLocationHash" fi |