zsh: sitepath() now gives encoded urls
This commit is contained in:
parent
0686197a84
commit
da5a43f313
1 changed files with 5 additions and 1 deletions
6
.zshrc
6
.zshrc
|
@ -324,7 +324,11 @@
|
||||||
[ -z ${1+x} ] && 1="$(pwd)"
|
[ -z ${1+x} ] && 1="$(pwd)"
|
||||||
FILEPATH="$(([ -e "$1" ] && readlink -f "$1") || fd $@ /home/blake/docker/blakenorth.net/site)"
|
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
|
# for sending error messages from functions and whatnot
|
||||||
|
|
Loading…
Add table
Reference in a new issue