mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
This is a shell script, not a function anymore
This commit is contained in:
parent
d5ab3fb62c
commit
de3c49c38d
1 changed files with 22 additions and 24 deletions
|
|
@ -47,8 +47,7 @@ HERE
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
sprunge() {
|
if [ -t 0 ]; then
|
||||||
if [ -t 0 ]; then
|
|
||||||
if [ "$*" ]; then
|
if [ "$*" ]; then
|
||||||
if [ -f "$*" ]; then
|
if [ -f "$*" ]; then
|
||||||
# Use python to attempt to detect the syntax
|
# Use python to attempt to detect the syntax
|
||||||
|
|
@ -62,16 +61,15 @@ sprunge() {
|
||||||
else
|
else
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
syntax="text" # We're dumb in this mode. So, dumb syntax highlighting!
|
syntax="text" # We're dumb in this mode. So, dumb syntax highlighting!
|
||||||
url=$(while read -r line ; do
|
url=$(while read -r line ; do
|
||||||
echo $line
|
echo $line
|
||||||
done | curl -F 'sprunge=<-' http://sprunge.us)
|
done | curl -F 'sprunge=<-' http://sprunge.us)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$syntax" != "text" ]; then
|
if [ "$syntax" != "text" ]; then
|
||||||
echo "$url?$syntax"
|
echo "$url?$syntax"
|
||||||
else
|
else
|
||||||
echo $url
|
echo $url
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue