From de62e9a1e6cf73340413e33bf38466acfdaa8f96 Mon Sep 17 00:00:00 2001 From: ackman678 Date: Fri, 18 Oct 2019 17:08:35 -0700 Subject: [PATCH] gitea ssh testing --- urlconv.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 urlconv.sh diff --git a/urlconv.sh b/urlconv.sh new file mode 100644 index 0000000..ded94b4 --- /dev/null +++ b/urlconv.sh @@ -0,0 +1,18 @@ +#!/bin/bash +if [ "$1" == "-h" ] ; then + echo " + urlconv - add blob to ipfs and convert corresponding referring url in a bibtex database file + + Usage: urlconv preprint.pdf references.bib + " + #echo "$(tput setaf 6)$EDITOR $(tput setaf 7)is currently set as editor" + exit 0 +fi + +fn=$1 +bibFile=$2 +relPath="ipfs://" + +hashid=$(ipfs add $fn | grep $fn | cut --delimiter=" " -f 2) + +sed -i -E "s|(\W*Url = \{).*$fn(\}.*)|\1$relPath$hashid\2|" $bibFile