mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Truly make python an optional dependency of the sprunge plugin
This commit is contained in:
parent
32eac165c0
commit
21caf6ea77
1 changed files with 8 additions and 4 deletions
|
|
@ -48,15 +48,19 @@ FILENAMES
|
||||||
HERE
|
HERE
|
||||||
}
|
}
|
||||||
|
|
||||||
sprunge_syntax() {
|
if (( $+commands[python] )); then
|
||||||
echo "try:
|
sprunge_syntax() {
|
||||||
|
echo "try:
|
||||||
from pygments.lexers import get_lexer_for_filename
|
from pygments.lexers import get_lexer_for_filename
|
||||||
print(get_lexer_for_filename('$1').aliases[0])
|
print(get_lexer_for_filename('$1').aliases[0])
|
||||||
except:
|
except:
|
||||||
print('text')" | python
|
print('text')" | python
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
sprunge_syntax() { echo 'text' }
|
||||||
|
fi
|
||||||
|
|
||||||
sprunge () {
|
sprunge() {
|
||||||
local urls url file syntax
|
local urls url file syntax
|
||||||
|
|
||||||
urls=()
|
urls=()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue