summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2020-06-01 14:29:55 +0200
committerAxel Beckert <abe@deuxchevaux.org>2021-09-15 01:54:32 +0200
commitfa46e8b0c30e4dfc880d6abb2503d0d05e75ed33 (patch)
treed8e5f72745fbca4fbf52306c09bb34ba02161887 /debian
parent656e42ecf2c019f1fe0d2ab07cbc69dcaec491d7 (diff)
downloadzsh-fa46e8b0c30e4dfc880d6abb2503d0d05e75ed33.tar.gz
zsh-fa46e8b0c30e4dfc880d6abb2503d0d05e75ed33.zip
debian/zshrc: Don't use grep to check if we're in Ubuntu
ZSH provides already everything to grep a file without having to use external programs, that can only cause a slowdown in the ZSH initialization. This can save some milliseconds at each zsh initialization, as we avoid a fork. Merges MR!2.
Diffstat (limited to 'debian')
-rw-r--r--debian/zshrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/debian/zshrc b/debian/zshrc
index 3fb974897..194f63699 100644
--- a/debian/zshrc
+++ b/debian/zshrc
@@ -106,7 +106,8 @@ autoload -Uz run-help
# If you don't want compinit called here, place the line
# skip_global_compinit=1
# in your $ZDOTDIR/.zshenv
-if grep -q '^ID.*=.*ubuntu' /etc/os-release && [[ -z "$skip_global_compinit" ]]; then
+if (( ${${(@f)"$(</etc/os-release)"}[(I)ID*=*ubuntu]} )) &&
+ [[ -z "$skip_global_compinit" ]]; then
autoload -U compinit
compinit
fi