diff options
author | Dario Vladović <d.vladimyr@gmail.com> | 2020-08-04 17:48:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 17:48:29 +0200 |
commit | 3935ccce647c722bcfdaa771b01613079db20935 (patch) | |
tree | 04997912e6a9023e8e83c41fbec4b89f16aa60c3 /lib/cli.zsh | |
parent | cf347ef3e43eabde5ae86e17d25690ebbeef5e6b (diff) | |
download | zsh-3935ccce647c722bcfdaa771b01613079db20935.tar.gz zsh-3935ccce647c722bcfdaa771b01613079db20935.tar.bz2 zsh-3935ccce647c722bcfdaa771b01613079db20935.zip |
cli: add update command (#9094)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
Diffstat (limited to 'lib/cli.zsh')
-rw-r--r-- | lib/cli.zsh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh index 73ac5a846..3c09cdab8 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -23,6 +23,7 @@ function _omz { local -a cmds subcmds cmds=( 'help:Usage information' + 'update:Update Oh My Zsh' 'pr:Commands for Oh My Zsh Pull Requests' ) @@ -48,6 +49,7 @@ Usage: omz <command> [options] Available commands: help Print this help message + update Update Oh My Zsh pr <command> Commands for Oh My Zsh Pull Requests EOF @@ -197,3 +199,12 @@ function _omz::pr::test { } ) } + +function _omz::update { + env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh" + # Update last updated file + zmodload zsh/datetime + echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update" + # Remove update lock if it exists + command rm -rf "$ZSH/log/update.lock" +} |