mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Added a log for sprunge links. No need to re-make them anymore :D Well, unless you have updated it.
This commit is contained in:
parent
d39d26b8fe
commit
630295efc8
1 changed files with 3 additions and 2 deletions
|
|
@ -43,6 +43,7 @@ sprunge() {
|
||||||
# read from stdin
|
# read from stdin
|
||||||
url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0)
|
url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0)
|
||||||
urls=(${url//[[:space:]]})
|
urls=(${url//[[:space:]]})
|
||||||
|
echo "stdin: $url"
|
||||||
else
|
else
|
||||||
# treat arguments as a list of files to upload
|
# treat arguments as a list of files to upload
|
||||||
for file in $@; do
|
for file in $@; do
|
||||||
|
|
@ -56,14 +57,14 @@ sprunge() {
|
||||||
url=${url//[[:space:]]}
|
url=${url//[[:space:]]}
|
||||||
[[ $syntax != text ]] && url=${url}?${syntax}
|
[[ $syntax != text ]] && url=${url}?${syntax}
|
||||||
|
|
||||||
|
echo "$file: $url" >> $OMZ/sprunge.log
|
||||||
urls+=(${url})
|
urls+=(${url})
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# output each url on its own line
|
# output each url on its own line
|
||||||
for url in $urls
|
for url in $urls
|
||||||
echo $url && echo $url >> "$OMZ/sprunge.log"
|
echo $url
|
||||||
|
|
||||||
|
|
||||||
# don't copy to clipboad if piped
|
# don't copy to clipboad if piped
|
||||||
[[ -t 1 ]] && sendtoclip $urls
|
[[ -t 1 ]] && sendtoclip $urls
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue