From cfeb8cd6c9f60c2a928f4c706d0137c7de2ef106 Mon Sep 17 00:00:00 2001 From: romkatv Date: Mon, 16 Mar 2020 08:34:02 +0100 Subject: [PATCH 1/4] prompt: update powerlevel10k submodule to v1.4.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.4.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index 7306efb..d53355c 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit 7306efb94ba739f714972038ad74c48d2bebfdd6 +Subproject commit d53355cd30acf8888bc1cf5caccea52f486c5584 From 1b99be879c84be12364ca9d1db553de61fd5586e Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 19 Mar 2020 11:19:25 -0700 Subject: [PATCH 2/4] Update syntax-highlighting module --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 35c8690..932e29a 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 35c8690c0025ceef9584f64da86ced3a72ee32b6 +Subproject commit 932e29a0c75411cb618f02995b66c0a4a25699bc From f4ca9ebfc913453f98ba6912a8c42684fd742cc1 Mon Sep 17 00:00:00 2001 From: Kaspar Vollenweider Date: Thu, 13 Feb 2020 09:56:29 +0100 Subject: [PATCH 3/4] feat(helper): add os-type helper functions Add the following functions: - is-darwin - is-linux - is-bsd - is-cygwin And apply them everywhere I found code doing that what these functions do. --- modules/haskell/init.zsh | 2 +- modules/helper/init.zsh | 20 ++++++++++++++++++++ modules/homebrew/init.zsh | 2 +- modules/macports/init.zsh | 2 +- modules/osx/init.zsh | 2 +- modules/perl/init.zsh | 2 +- modules/python/init.zsh | 2 +- modules/rsync/init.zsh | 2 +- modules/utility/init.zsh | 6 +++--- 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/modules/haskell/init.zsh b/modules/haskell/init.zsh index c1c78ca..7863528 100644 --- a/modules/haskell/init.zsh +++ b/modules/haskell/init.zsh @@ -11,7 +11,7 @@ if (( ! $+commands[ghc] )); then fi # Prepend Cabal per user directories to PATH. -if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then +if is-darwin && [[ -d $HOME/Library/Haskell ]]; then path=($HOME/Library/Haskell/bin(/N) $path) else path=($HOME/.cabal/bin(/N) $path) diff --git a/modules/helper/init.zsh b/modules/helper/init.zsh index 328bed4..6e83f89 100644 --- a/modules/helper/init.zsh +++ b/modules/helper/init.zsh @@ -29,3 +29,23 @@ function coalesce { done return 1 } + +# is true on MacOS Darwin +function is-darwin { + [[ "$OSTYPE" == darwin* ]] +} + +# is true on Linux's +function is-linux { + [[ "$OSTYPE" == linux* ]] +} + +# is true on BSD's +function is-bsd { + [[ "$OSTYPE" == *bsd* ]] +} + +# is true on Cygwin (Windows) +function is-cygwin { + [[ "$OSTYPE" == cygwin* ]] +} diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 9f7e0b4..6605426 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != (darwin|linux)* ]]; then +if ! is-darwin || ! is-linux; then return 1 fi diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index d55744a..943ff5b 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -7,7 +7,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then +if ! is-darwin; then return 1 fi diff --git a/modules/osx/init.zsh b/modules/osx/init.zsh index f7871ca..2b74d3a 100644 --- a/modules/osx/init.zsh +++ b/modules/osx/init.zsh @@ -6,7 +6,7 @@ # # Return if requirements are not found. -if [[ "$OSTYPE" != darwin* ]]; then +if ! is-darwin; then return 1 fi diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index b7a7947..50e9b64 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -37,7 +37,7 @@ fi # Local Module Installation # -if [[ "$OSTYPE" == darwin* ]]; then +if is-darwin; then # Perl is slow; cache its output. cache_file="${TMPDIR:-/tmp}/prezto-perl-cache.$UID.zsh" perl_path="$HOME/Library/Perl/5.12" diff --git a/modules/python/init.zsh b/modules/python/init.zsh index e5967f7..a7e8b6e 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -22,7 +22,7 @@ elif (( $+commands[pyenv] )); then else if [[ -n "$PYTHONUSERBASE" ]]; then path=($PYTHONUSERBASE/bin $path) - elif [[ "$OSTYPE" == darwin* ]]; then + elif is-darwin; then path=($HOME/Library/Python/*/bin(N) $path) else # This is subject to change. diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index b3010ed..f2eb891 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -23,7 +23,7 @@ fi # macOS and HFS+ Enhancements # https://bombich.com/kb/ccc5/credits -if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then +if is-darwin && grep -q 'file-flags' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change" fi diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index a2e5c2b..caa0ec8 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -134,9 +134,9 @@ if zstyle -t ':prezto:module:utility:grep' color; then fi # macOS Everywhere -if [[ "$OSTYPE" == darwin* ]]; then +if is-darwin; then alias o='open' -elif [[ "$OSTYPE" == cygwin* ]]; then +elif is-cygwin; then alias o='cygstart' alias pbcopy='tee > /dev/clipboard' alias pbpaste='cat /dev/clipboard' @@ -166,7 +166,7 @@ fi alias df='df -kh' alias du='du -kh' -if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then +if is-darwin || is-bsd; then alias topc='top -o cpu' alias topm='top -o vsize' else From f479f37ead5476c1c5029ed7476375cb7eed562f Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 22 Mar 2020 17:31:35 +0100 Subject: [PATCH 4/4] prompt: update powerlevel10k submodule to v1.5.0 Release notes: https://github.com/romkatv/powerlevel10k/releases/tag/v1.5.0 --- modules/prompt/external/powerlevel10k | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/external/powerlevel10k b/modules/prompt/external/powerlevel10k index d53355c..6a0e752 160000 --- a/modules/prompt/external/powerlevel10k +++ b/modules/prompt/external/powerlevel10k @@ -1 +1 @@ -Subproject commit d53355cd30acf8888bc1cf5caccea52f486c5584 +Subproject commit 6a0e7523b232d02854008405a3645031c848922b