Skip to content

Instantly share code, notes, and snippets.

@liuqinh2s
Last active September 13, 2018 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save liuqinh2s/0864ed7799b161bb2f048b4fab867d5a to your computer and use it in GitHub Desktop.
Save liuqinh2s/0864ed7799b161bb2f048b4fab867d5a to your computer and use it in GitHub Desktop.
idString=`ipfs id`
str="ID\": \""
subIdStr=${idString#*$str}
str1="\","
subIdStr1=${subIdStr%%$str1*}
echo $subIdStr1
sed -i "" "/root: / s/\/ipns\/$subIdStr1\//\//" _config.yml
sed -i "" "/url: / s/http:\/\/ipfs.io\/ipns\/$subIdStr1/http:\/\/liuqinh2s.github.io/" _config.yml
hexo clean
hexo g -d
sed -i "" "/root: / s/\//\/ipns\/${subIdStr1}\//" _config.yml
sed -i "" "/url: / s/http:\/\/liuqinh2s.github.io/http:\/\/ipfs.io\/ipns\/${subIdStr1}/" _config.yml
hexo clean
hexo g
string=`ipfs add -r public/`
subStr=${string##*added }
subStr1=${subStr% public}
ipfs name publish $subStr1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment