diff --git a/README.md b/README.md index 3324209..f79149a 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,10 @@ An oh-my-zsh theme. ## Usage REF: [Oh-My-Zsh External themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) + +### Trouble Shooting + +#### macOS +passsion.zsh-theme uses cmd ```gdate``` to get current time in milliseconds which is not installed default in macOS. + +run ```brew install coreutils;``` to get ```gdate```; \ No newline at end of file diff --git a/passion.zsh-theme b/passion.zsh-theme index 7794ae7..086da82 100644 --- a/passion.zsh-theme +++ b/passion.zsh-theme @@ -1,4 +1,16 @@ +# gdate for macOS +# REF: https://apple.stackexchange.com/questions/135742/time-in-milliseconds-since-epoch-in-the-terminal +if [[ "$OSTYPE" == "darwin"* ]]; then + { + gdate + } || { + echo "\n$fg_bold[yellow]zsh theme passion needs gdate in coreutils:$reset_color" + echo "$fg_bold[green]brew install coreutils;\n$reset_color"; + } +fi + + # time function real_time() { local color="%{$fg_no_bold[cyan]%}"; # color in PROMPT need format in %{XXX%} which is not same with echo