summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-07-17 04:14:29 -0500
committermsglm <msglm@techchud.xyz>2023-07-17 04:14:29 -0500
commita391d251dd0d9165581f2713d6afaf7c85997c1f (patch)
tree147e9f55d9c355c608e620d11edec0eb84fc34a7
parentea3e098a055679396a37739bef88a90980eadf5e (diff)
downloadstashley-1.0.4.tar.gz
stashley-1.0.4.tar.bz2
stashley-1.0.4.zip
IPFS publishing is now optionalv1.0.4
-rw-r--r--README.md2
-rwxr-xr-xstashley25
2 files changed, 14 insertions, 13 deletions
diff --git a/README.md b/README.md
index faa8f54..621bb35 100644
--- a/README.md
+++ b/README.md
@@ -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"]
diff --git a/stashley b/stashley
index ec6a97c..b24df37 100755
--- a/stashley
+++ b/stashley
@@ -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