zsh: sitepath() now gives encoded urls

This commit is contained in:
PowerUser64 2021-11-30 00:44:00 -08:00
parent 0686197a84
commit da5a43f313

6
.zshrc
View file

@ -324,7 +324,11 @@
[ -z ${1+x} ] && 1="$(pwd)"
FILEPATH="$(([ -e "$1" ] && readlink -f "$1") || fd $@ /home/blake/docker/blakenorth.net/site)"
echo "$FILEPATH" | grep -o 'site.*' | sed 's+^site+https://blakenorth.net+g'
# change all file paths into urls
echo "$FILEPATH" |
grep -o 'site.*' `# remove path to site dir` |
sed 's+^site+https://blakenorth.net+g' `# add site name` |
urlencode # if you need this, I am using dead10ck/urlencode (cargo install urlencode)
}
# for sending error messages from functions and whatnot