From cd4918c2cdb6613cf77ea8f6f29e1930bd7f4bf5 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 19 Jan 2021 16:48:57 -0800 Subject: Bump year to 2021 --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 45ba85a37..becd6a7bd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2009-2020 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors) +Copyright (c) 2009-2021 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal -- cgit v1.2.3-70-g09d2 From d978f385e52a19f2fd41e8c7ceb2f7c0a4dfc56c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 21 Jan 2021 11:52:09 +0100 Subject: fix(updater): refresh date of last update only on successful update --- tools/check_for_upgrade.sh | 4 +++- tools/upgrade.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index d0ceba92d..88e521eea 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -25,7 +25,9 @@ function update_last_updated_file() { function update_ohmyzsh() { ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive - update_last_updated_file + if [[ "$?" = (0|80) ]]; then + update_last_updated_file + fi } () { diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 358242d0f..4b97540d6 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,7 +1,7 @@ #!/usr/bin/env zsh if [ -z "$ZSH_VERSION" ]; then - exec zsh "$0" + exec zsh "$0" "$@" fi cd "$ZSH" -- cgit v1.2.3-70-g09d2 From f75f8bb930c6c7aed5e4e7bded94936f6d9f7724 Mon Sep 17 00:00:00 2001 From: Aidin Gharibnavaz Date: Thu, 28 Jan 2021 05:28:04 +1300 Subject: docs(git-prompt): explain stashed icon (⚑) (#9619) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stashed icon was added in #4880 --- plugins/git-prompt/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md index 83948f536..c6610fa94 100644 --- a/plugins/git-prompt/README.md +++ b/plugins/git-prompt/README.md @@ -24,6 +24,7 @@ The prompt may look like the following: - `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed - `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean - `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean +- `(master|⚑2)`: on branch `master`, there are 2 stashed changes ## Prompt Structure @@ -43,6 +44,7 @@ The symbols are as follows: | ●n | there are `n` staged files | | ✖n | there are `n` unmerged files | | ✚n | there are `n` unstaged files | +| ⚑n | there are `n` stashed changes | | … | there are some untracked files | ### Branch Tracking Symbols -- cgit v1.2.3-70-g09d2 From c52e646bb7b109e15f6dc4047b29ca8c8e029433 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 31 Jan 2021 19:55:13 +0100 Subject: refactor(gallois): clean up theme and fix typos --- themes/gallois.zsh-theme | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme index e6c2d8142..bb97bfb17 100644 --- a/themes/gallois.zsh-theme +++ b/themes/gallois.zsh-theme @@ -1,16 +1,18 @@ # Depends on the git plugin for work_in_progress() +(( $+functions[work_in_progress] )) || work_in_progress() {} ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}[" ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" ZSH_THEME_GIT_PROMPT_CLEAN="" -#Customized git status, oh-my-zsh currently does not allow render dirty status before branch +# Customized git status, oh-my-zsh currently does not allow render dirty status before branch git_custom_status() { - local cb=$(git_current_branch) - if [ -n "$cb" ]; then - echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" - fi + local branch=$(git_current_branch) + [[ -n "$branch" ]] || return 0 + echo "$(parse_git_dirty)\ +%{${fg_bold[yellow]}%}$(work_in_progress)%{$reset_color%}\ +${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}${ZSH_THEME_GIT_PROMPT_SUFFIX}" } # RVM component of prompt @@ -18,6 +20,5 @@ ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}[" ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}" # Combine it all into a final right-side prompt -RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1' - +RPS1="\$(git_custom_status)\$(ruby_prompt_info)${RPS1:+ $RPS1}" PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' -- cgit v1.2.3-70-g09d2 From f21e646ce6c09198f7f625c597f08af49551fdb0 Mon Sep 17 00:00:00 2001 From: iammordaty Date: Tue, 9 Feb 2021 15:00:10 +0100 Subject: refactor(git-flow): remove duplicate `gflfp` alias (#9640) Fixes #9638 --- plugins/git-flow/git-flow.plugin.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index eab969d8a..916cd5693 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -36,7 +36,6 @@ alias gflff='git flow feature finish' alias gflfp='git flow feature publish' alias gflhf='git flow hotfix finish' alias gflrf='git flow release finish' -alias gflfp='git flow feature publish' alias gflhp='git flow hotfix publish' alias gflrp='git flow release publish' alias gflfpll='git flow feature pull' -- cgit v1.2.3-70-g09d2 From 7a8d89688d080de28acf94fe995694f911e96c73 Mon Sep 17 00:00:00 2001 From: Kartikey Tanna Date: Sun, 21 Feb 2021 11:54:21 +0530 Subject: Replce 'rake routes' task with 'rails rotues' (#9662) * Replce 'rake routes' task with 'rails rotues' Fixes https://github.com/ohmyzsh/ohmyzsh/issues/9661 * Modified 'rake routes|grep' to use rails --- plugins/rails/rails.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index 1fd5f0f86..5b0be4f85 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -46,6 +46,8 @@ alias rdb='rails dbconsole' alias rgen='rails generate' alias rgm='rails generate migration' alias rp='rails plugin' +alias rr='rails routes' +alias rrg='rails routes | grep' alias ru='rails runner' alias rs='rails server' alias rsd='rails server --debugger' @@ -65,8 +67,6 @@ alias rdmtc='rake db:migrate db:test:clone' alias rdsl='rake db:schema:load' alias rlc='rake log:clear' alias rn='rake notes' -alias rr='rake routes' -alias rrg='rake routes | grep' alias rt='rake test' alias rmd='rake middleware' alias rsts='rake stats' -- cgit v1.2.3-70-g09d2 From 27bf8318432c46c34743b6b67a5a3e145f1b3e83 Mon Sep 17 00:00:00 2001 From: Vikas Raj Date: Sun, 21 Feb 2021 11:57:27 +0530 Subject: [docker-compose] Added alias for docker-compose up --build (#8843) * [docker-compose] Added alias for docker-compose up --build Sometimes building images before starting the containers comes in handy. Alias: `dcupb` Command: `docker-compose up --build` * Updated docker-compose/README.md Added the alias definition in the readme Co-authored-by: Robby Russell --- plugins/docker-compose/README.md | 37 ++++++++++++------------ plugins/docker-compose/docker-compose.plugin.zsh | 1 + 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md index a81c2c78e..13f3c2cea 100644 --- a/plugins/docker-compose/README.md +++ b/plugins/docker-compose/README.md @@ -11,21 +11,22 @@ plugins=(... docker-compose) ## Aliases -| Alias | Command | Description | -|-----------|--------------------------|------------------------------------------------------------------| -| dco | `docker-compose` | Docker-compose main command | -| dcb | `docker-compose build` | Build containers | -| dce | `docker-compose exec` | Execute command inside a container | -| dcps | `docker-compose ps` | List containers | -| dcrestart | `docker-compose restart` | Restart container | -| dcrm | `docker-compose rm` | Remove container | -| dcr | `docker-compose run` | Run a command in container | -| dcstop | `docker-compose stop` | Stop a container | -| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service | -| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon | -| dcdn | `docker-compose down` | Stop and remove containers | -| dcl | `docker-compose logs` | Show logs of container | -| dclf | `docker-compose logs -f` | Show logs and follow output | -| dcpull | `docker-compose pull` | Pull image of a service | -| dcstart | `docker-compose start` | Start a container | -| dck | `docker-compose kill` | Kills containers | +| Alias | Command | Description | +|-----------|--------------------------------|------------------------------------------------------------------| +| dco | `docker-compose` | Docker-compose main command | +| dcb | `docker-compose build` | Build containers | +| dce | `docker-compose exec` | Execute command inside a container | +| dcps | `docker-compose ps` | List containers | +| dcrestart | `docker-compose restart` | Restart container | +| dcrm | `docker-compose rm` | Remove container | +| dcr | `docker-compose run` | Run a command in container | +| dcstop | `docker-compose stop` | Stop a container | +| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service | +| dcupb | `docker-compose up --build` | Same as `dcup`, but build images before starting containers | +| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon | +| dcdn | `docker-compose down` | Stop and remove containers | +| dcl | `docker-compose logs` | Show logs of container | +| dclf | `docker-compose logs -f` | Show logs and follow output | +| dcpull | `docker-compose pull` | Pull image of a service | +| dcstart | `docker-compose start` | Start a container | +| dck | `docker-compose kill` | Kills containers | diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh index 5b25b63b9..85e03d343 100644 --- a/plugins/docker-compose/docker-compose.plugin.zsh +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -18,6 +18,7 @@ alias dcrm='docker-compose rm' alias dcr='docker-compose run' alias dcstop='docker-compose stop' alias dcup='docker-compose up' +alias dcupb='docker-compose up --build' alias dcupd='docker-compose up -d' alias dcdn='docker-compose down' alias dcl='docker-compose logs' -- cgit v1.2.3-70-g09d2 From 9a9f3831925432fdf4352c24a002506a06d329c1 Mon Sep 17 00:00:00 2001 From: Gustavo Bazan Date: Sun, 21 Feb 2021 06:29:54 +0000 Subject: feat: add mongocli plugin (#9248) --- plugins/mongocli/README.md | 19 +++++++++++++++++++ plugins/mongocli/mongocli.plugin.zsh | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 plugins/mongocli/README.md create mode 100644 plugins/mongocli/mongocli.plugin.zsh diff --git a/plugins/mongocli/README.md b/plugins/mongocli/README.md new file mode 100644 index 000000000..e245f2a4a --- /dev/null +++ b/plugins/mongocli/README.md @@ -0,0 +1,19 @@ +# mongocli plugin + +The plugin adds several aliases for common [mongocli](https://docs.mongodb.com/mongocli/stable/) commands. + +To use it, add `mongocli` to the plugins array of your zshrc file: + +```zsh +plugins=(... mongocli) +``` + +## Aliases + +| Alias | Command | Description | +|----------|-------------------------------------------------------------|--------------------------------------------------------| +| `ma` | `mongocli atlas` | Shortcut for mongocli Atlas commands. | +| `mcm` | `mongocli cloud-manager` | Shortcut for mongocli Cloud Manager commands. | +| `mom` | `mongocli ops-manager` | Shortcut for mongocli Cloud Manager commands. | +| `miam` | `mongocli iam` | Shortcut for mongocli IAM commands. | + diff --git a/plugins/mongocli/mongocli.plugin.zsh b/plugins/mongocli/mongocli.plugin.zsh new file mode 100644 index 000000000..0ca877e61 --- /dev/null +++ b/plugins/mongocli/mongocli.plugin.zsh @@ -0,0 +1,4 @@ +alias ma='mongocli atlas' +alias mcm='mongocli cloud-manager' +alias mom='mongocli ops-manager' +alias miam='mongocli iam' -- cgit v1.2.3-70-g09d2 From 6fbad5bf72fad4ecf30ba4d4ffee62bac582f0ed Mon Sep 17 00:00:00 2001 From: Cai Cooper <2406847+cagiti@users.noreply.github.com> Date: Mon, 1 Mar 2021 07:17:54 +0000 Subject: fix(update): don't error on upgrade no-op (#9685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don't error on upgrade no-op No error code is required for a non failure scenario. * Manually check whether changes were pulled in `omz update` Co-authored-by: Marc Cornellà --- lib/cli.zsh | 7 ++++--- tools/check_for_upgrade.sh | 3 +-- tools/upgrade.sh | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 3346d3973..38e2f72f8 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -401,13 +401,14 @@ function _omz::theme::use { } function _omz::update { + local last_commit=$(cd "$ZSH"; git rev-parse HEAD) + # Run update script if [[ "$1" != --unattended ]]; then ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive else ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" fi - local ret=$? # Update last updated file zmodload zsh/datetime @@ -415,8 +416,8 @@ function _omz::update { # Remove update lock if it exists command rm -rf "$ZSH/log/update.lock" - # Restart the zsh session - if [[ $ret -eq 0 && "$1" != --unattended ]]; then + # Restart the zsh session if there were changes + if [[ "$1" != --unattended && "$(cd "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # Check whether to run a login shell diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 88e521eea..29a48b880 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -24,8 +24,7 @@ function update_last_updated_file() { } function update_ohmyzsh() { - ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive - if [[ "$?" = (0|80) ]]; then + if ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive; then update_last_updated_file fi } diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 4b97540d6..417e06fe8 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -66,7 +66,6 @@ if git pull --rebase --stat origin master; then # Check if it was really updated or not if [[ "$(git rev-parse HEAD)" = "$last_commit" ]]; then message="Oh My Zsh is already at the latest version." - ret=80 # non-zero exit code to indicate no changes pulled else message="Hooray! Oh My Zsh has been updated!" -- cgit v1.2.3-70-g09d2