From da5a43f31355bce0067d884e64fea687e581a7e6 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Tue, 30 Nov 2021 00:44:00 -0800 Subject: [PATCH] zsh: sitepath() now gives encoded urls --- .zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 795e835..bd2caab 100644 --- a/.zshrc +++ b/.zshrc @@ -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