step 1 of ~20 for git-ssb.  please repost git-nostr is important and needs funding.

#!/bin/bash

usage()

{

echo "

Usage: git nostr create [] [options]

ex: git nostr create nostr ws://192.168.1.164:8080

Create a new git-nostr repo and add it as a git remote

Options:

--private (not implemented) Make repo private

--recps ,... (not implemented) List of recipients for a private repo. Implies --private

--secretkey nostr secret key

--relay nostr relay url

"

exit 2

}

if [ $# -lt 1 ]

then

usage

exit 1

fi

PRIVATE=0

while [[ $# -gt 0 ]]

do

key="$1"

case $key in

-h | --help)

usage

;;

--private)

PRIVATE=true

git config nostr.private $PRIVATE

shift

;;

--recps)

RECIPIENTS="$2"

git config nostr.recps $RECIPIENTS

shift

shift

;;

--secretkey)

SECRETKEY="$2"

shift

shift

;;

*)

if [ -z "$REMOTENAME" ]; then

REMOTENAME="$1"

else

NOSTRRELAY="$1"

fi

shift

;;

esac

done

if ["$SECRETKEY" -eq ""]; then

SECRETKEY=`git config --get nostr.secretkey`

fi

if ["$SECRETKEY" -eq ""]; then

SECRETKEY=`noscl key-gen|grep private|awk '{print$3}'`

git config nostr.secretkey $SECRETKEY

fi

git remote add $REMOTENAME $NOSTRRELAY

nostril --envelope --sec "$SECRETKEY" --kind 17 --tag e "git-repo" --content "git-nostr" | websocat ws://192.168.1.164:8080

echo "created nostr public key: "`nostril --sec $SECRETKEY | jq .pubkey|sed 's/\"//g'`

Reply to this note

Please Login to reply.

Discussion

I'm an idiot it is called git-nostr which is going for feature parity with git-ssb