diff options
author | msglm <msglm@techchud.xyz> | 2023-07-17 04:14:29 -0500 |
---|---|---|
committer | msglm <msglm@techchud.xyz> | 2023-07-17 04:14:29 -0500 |
commit | a391d251dd0d9165581f2713d6afaf7c85997c1f (patch) | |
tree | 147e9f55d9c355c608e620d11edec0eb84fc34a7 | |
parent | ea3e098a055679396a37739bef88a90980eadf5e (diff) | |
download | stashley-a391d251dd0d9165581f2713d6afaf7c85997c1f.tar.gz stashley-a391d251dd0d9165581f2713d6afaf7c85997c1f.tar.bz2 stashley-a391d251dd0d9165581f2713d6afaf7c85997c1f.zip |
IPFS publishing is now optionalv1.0.4
-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 |