mirror of
https://github.com/ChesterYue/ohmyzsh-theme-passion.git
synced 2026-07-21 20:11:03 +00:00
Remove gdate dependency
This commit is contained in:
parent
7f06398c0a
commit
e765831b0a
2 changed files with 1 additions and 21 deletions
|
|
@ -27,11 +27,6 @@ An oh-my-zsh theme;
|
|||
|
||||
#### Trouble Shooting
|
||||
|
||||
##### macOS, command not found: gdate
|
||||
|
||||
* passion.zsh-theme depends on cmd ```gdate``` to get current time in milliseconds. get ```gdate``` on macOS by running ```brew install coreutils``` then ```source ~/.zshrc```;
|
||||
* see also: [#12](https://github.com/ChesterYue/ohmyzsh-theme-passion/issues/12);
|
||||
|
||||
##### Linux, command not found: bc
|
||||
|
||||
* passion.zsh-theme depends on cmd ```bc``` to calculate the command running time cost. [get bc on Linux](https://www.tecmint.com/bc-command-examples/#:~:text=If%20you%20don%E2%80%99t%20have%20bc%20on%20your%20system%2C,command%20prompt%20and%20simply%20start%20calculating%20your%20expressions.) then ```source ~/.zshrc```;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,4 @@
|
|||
|
||||
# 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]passion.zsh-theme depends on cmd [gdate] to get current time in milliseconds$reset_color"
|
||||
echo "$fg_bold[yellow][gdate] is not installed by default in macOS$reset_color"
|
||||
echo "$fg_bold[yellow]to get [gdate] by running:$reset_color"
|
||||
echo "$fg_bold[green]brew install coreutils;$reset_color";
|
||||
echo "$fg_bold[yellow]\nREF: https://github.com/ChesterYue/ohmyzsh-theme-passion#macos\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
|
||||
|
|
@ -151,7 +136,7 @@ current_time_millis() {
|
|||
time_millis="$(date +%s.%3N)";
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# macOS
|
||||
time_millis="$(gdate +%s.%3N)";
|
||||
time_millis="$(perl -MTime::HiRes -e 'printf("%.3f\n",Time::HiRes::time())')";
|
||||
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||||
# POSIX compatibility layer and Linux environment emulation for Windows
|
||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue