mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Its better practise to use [[ and ]] rather than [ and ]
This commit is contained in:
parent
bb90815dd9
commit
c5404482a5
1 changed files with 5 additions and 5 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
# if [[ ${_plugin__path} == "on" ]]; then
|
# if [[ ${_plugin__path} == "on" ]]; then
|
||||||
# Plugin setting: Add this plugin directory to the path
|
# Plugin setting: Add this plugin directory to the path
|
||||||
# export PATH=$PATH:$ZSH/plugins/sprunge
|
# export PATH=$PATH:$ZSH/plugins/sprunge
|
||||||
# elif [ -z "${commands[sprunge]}" ]; then
|
# elif [[ -z "${commands[sprunge]}" ]]; then
|
||||||
# Nope. No `sprunge` command, period. So, dumb/simple alias, here we go!
|
# Nope. No `sprunge` command, period. So, dumb/simple alias, here we go!
|
||||||
# alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/"
|
# alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/"
|
||||||
# fi
|
# fi
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
# Original found at http://www.shellperson.net/sprunge-pastebin-script/
|
# Original found at http://www.shellperson.net/sprunge-pastebin-script/
|
||||||
|
|
||||||
sprunge () {
|
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
|
||||||
syntax=$(echo "try:
|
syntax=$(echo "try:
|
||||||
from pygments.lexers import get_lexer_for_filename
|
from pygments.lexers import get_lexer_for_filename
|
||||||
|
|
@ -81,7 +81,7 @@ HERE
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue