gem-update/gem-update.fish

31 lines
697 B
Fish

#!/usr/bin/env fish
# save current working directory
set cwd (pwd)
# List remote's new and modified files
echo "Updating gemlog from remote repo" \n
cd ~/public_gemini
git fetch
# save them in fish array $changed
set changed (git diff --name-status main origin/main | cut -f2)
echo "New or changed files: $changed" \n
# Pull from tildegit repo holding my gemlog content
git pull
# Convert gmi to html
echo "Converting gemlog to html"
cd ~/code/geminut
# Converting all new and converted gmi files -> html files
for i in $changed
echo "converting $i"
set file (basename $i .gmi)
node geminut $i ~/public_html/$file.html
end
# Change back to original directory
cd $cwd
echo "Completed"