From 17e96bf91ee0bc3dc27fa65b0ea7b10d3b971f9d Mon Sep 17 00:00:00 2001 From: Gautam krishna R Date: Thu, 21 Dec 2023 01:40:32 +0530 Subject: fix(changelog): use longer hashes for commits (#12096) --- tools/changelog.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index 6d768963e..3ad8fe786 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -292,16 +292,17 @@ function display-release { function fmt:hash { #* Uses $hash from outer scope local hash="${1:-$hash}" + local short_hash="${hash:0:7}" # 7 characters sha, top level sha is 12 characters case "$output" in - raw) printf '%s' "$hash" ;; + raw) printf '%s' "$short_hash" ;; text) - local text="\e[33m$hash\e[0m"; # red + local text="\e[33m$short_hash\e[0m"; # red if supports_hyperlinks; then printf "\e]8;;%s\a%s\e]8;;\a" "https://github.com/ohmyzsh/ohmyzsh/commit/$hash" $text; else echo $text; fi ;; - md) printf '[`%s`](https://github.com/ohmyzsh/ohmyzsh/commit/%s)' "$hash" "$hash" ;; + md) printf '[`%s`](https://github.com/ohmyzsh/ohmyzsh/commit/%s)' "$short_hash" "$hash" ;; esac } @@ -512,13 +513,13 @@ function main { # Git log options # -z: commits are delimited by null bytes # --format: [7-char hash][ref names][subject][body] - # --abbrev=7: force commit hashes to be 7 characters long + # --abbrev=7: force commit hashes to be 12 characters long # --no-merges: merge commits are omitted # --first-parent: commits from merged branches are omitted local SEP="0mZmAgIcSeP" local -a raw_commits raw_commits=(${(0)"$(command git -c log.showSignature=false log -z \ - --format="%h${SEP}%D${SEP}%s${SEP}%b" --abbrev=7 \ + --format="%h${SEP}%D${SEP}%s${SEP}%b" --abbrev=12 \ --no-merges --first-parent $range)"}) local raw_commit -- cgit v1.2.3-70-g09d2 From 4fca7ccb55eb4904f515806ffca51d27ee1cc670 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Thu, 7 Mar 2024 03:54:43 -0500 Subject: feat(tools): update `supports_hyperlinks` (#12258) Update to https://github.com/zkat/supports-hyperlinks/releases/tag/v3.0.0 --- tools/changelog.sh | 11 ++++++++--- tools/install.sh | 11 ++++++++--- tools/upgrade.sh | 11 ++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index 3ad8fe786..c4b26079e 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -221,11 +221,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi diff --git a/tools/install.sh b/tools/install.sh index 508fc2f77..e3613a28b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -166,11 +166,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi diff --git a/tools/upgrade.sh b/tools/upgrade.sh index f7a263d66..d7016aa44 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -90,11 +90,16 @@ supports_hyperlinks() { # If $TERM_PROGRAM is set, these terminals support hyperlinks case "$TERM_PROGRAM" in - Hyper|iTerm.app|terminology|WezTerm) return 0 ;; + Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;; esac - # kitty supports hyperlinks - if [ "$TERM" = xterm-kitty ]; then + # These termcap entries support hyperlinks + case "$TERM" in + xterm-kitty|alacritty|alacritty-direct) return 0 ;; + esac + + # xfce4-terminal supports hyperlinks + if [ "$COLORTERM" = "xfce4-terminal" ]; then return 0 fi -- cgit v1.2.3-70-g09d2 From c262ffbb68e6dfc30b619e6ce6bdbd00f27b8a71 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 18 Apr 2024 07:16:42 +0200 Subject: fix(update): define `$ZSH` if undefined (#12273) Fixes #12273 Fixes https://github.com/topgrade-rs/topgrade/issues/519 --- tools/upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/upgrade.sh b/tools/upgrade.sh index d7016aa44..5eb90ab41 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -10,9 +10,14 @@ fi # Protect against unwanted sourcing case "$ZSH_EVAL_CONTEXT" in - *:file) echo "error: this file should not be sourced" && return ;; + *:file) echo "error: this file should not be sourced" && return 1 ;; esac +# Define "$ZSH" if not defined -- in theory this should be `export`ed by the calling script +if [[ -z "$ZSH" ]]; then + ZSH="${0:a:h:h}" +fi + cd "$ZSH" verbose_mode="default" -- cgit v1.2.3-70-g09d2 From 56cfcb44e7ff730c10c5a00b58f38c33c984c52e Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 18 Apr 2024 07:33:13 +0200 Subject: fix(updater): abort update if `$ZSH` is not a git repository Fixes #12298 --- lib/cli.zsh | 12 +++++++++++- tools/check_for_upgrade.sh | 10 ++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/lib/cli.zsh b/lib/cli.zsh index aa36a6ab5..4a8d4d127 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -773,7 +773,17 @@ function _omz::theme::use { } function _omz::update { - local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD) + # Check if git command is available + (( $+commands[git] )) || { + _omz::log error "git is not installed. Aborting..." + return 1 + } + + local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null) + [[ $? -eq 0 ]] || { + _omz::log error "\`$ZSH\` is not a git directory. Aborting..." + return 1 + } # Run update script zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 1cc193bde..a5d2112f6 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -20,14 +20,16 @@ zstyle -s ':omz:update' mode update_mode || { } # Cancel update if: -# - the automatic update is disabled. -# - the current user doesn't have write permissions nor owns the $ZSH directory. +# - the automatic update is disabled +# - the current user doesn't have write permissions nor owns the $ZSH directory # - is not run from a tty -# - git is unavailable on the system. +# - git is unavailable on the system +# - $ZSH is not a git repository if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ || [[ ! -t 1 ]] \ - || ! command git --version 2>&1 >/dev/null; then + || ! command git --version 2>&1 >/dev/null + || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode return fi -- cgit v1.2.3-70-g09d2 From 80a651a6dfafc40630b47ad2f173d326844d6925 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 18 Apr 2024 07:48:33 +0200 Subject: chore(updater): small typo --- tools/check_for_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index a5d2112f6..1ecab5c0b 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -28,7 +28,7 @@ zstyle -s ':omz:update' mode update_mode || { if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ || [[ ! -t 1 ]] \ - || ! command git --version 2>&1 >/dev/null + || ! command git --version 2>&1 >/dev/null \ || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode return -- cgit v1.2.3-70-g09d2 From 35f1d362c1c3169aaaf3600886382661af1fc647 Mon Sep 17 00:00:00 2001 From: Ihor Date: Tue, 2 Jul 2024 17:15:22 +0200 Subject: docs: rename twitter to X, fix link (#12532) --- README.md | 2 +- tools/upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/README.md b/README.md index 2d873c514..105c5db89 100644 --- a/README.md +++ b/README.md @@ -486,4 +486,4 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt). ![Planet Argon](https://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg) -Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](http://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). +Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github). diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 5eb90ab41..c586610c4 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -271,7 +271,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET printf '\n' printf "${BLUE}%s${RESET}\n\n" "$message" - printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)" + printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on X:" "$(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" elif [[ $verbose_mode == minimal ]]; then -- cgit v1.2.3-70-g09d2 From 057f3ec67e65661d3c01b757ec5cad0a3718453e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 3 Jul 2024 08:51:19 +0200 Subject: chore: replace all instances of twitter with X Closes #12536 --- README.md | 4 ++-- tools/install.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/README.md b/README.md index 105c5db89..e9a571a37 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 -To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and join us on [Discord](https://discord.gg/ohmyzsh). +To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter), and join us on [Discord](https://discord.gg/ohmyzsh). [![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ohmyzsh?label=%40ohmyzsh&logo=x&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) @@ -469,7 +469,7 @@ Thank you so much! We're on social media: -- [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. You should follow it. +- [@ohmyzsh](https://x.com/ohmyzsh) on X (formerly Twitter). You should follow it. - [Facebook](https://www.facebook.com/Oh-My-Zsh-296616263819290/) poke us. - [Instagram](https://www.instagram.com/_ohmyzsh/) tag us in your post showing Oh My Zsh! - [Discord](https://discord.gg/ohmyzsh) to chat with us! diff --git a/tools/install.sh b/tools/install.sh index e3613a28b..e5f126915 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -482,7 +482,7 @@ print_success() { "$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \ "file to select plugins, themes, and options." printf '\n' - printf '%s\n' "• Follow us on Twitter: $(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)" + printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)" printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" printf '%s\n' $FMT_RESET -- cgit v1.2.3-70-g09d2 From 0c8ce9d6adf9982c2f024c42f13b9781fd9846f0 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 3 Oct 2024 01:47:33 -0700 Subject: fix(theme-chooser): use `env` in shebang (#12720) --- tools/theme_chooser.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 3883f1d37..ab270e8e1 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # Zsh Theme Chooser by fox (fox91 at anche dot no) # This program is free software. It comes without any warranty, to -- cgit v1.2.3-70-g09d2 From 4e29c670a48a17276d04b3e47262b10f28dfcc0b Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 23 Jan 2025 20:38:12 +0100 Subject: fix(changelog): show if there are no changes (#12934) --- tools/changelog.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index c4b26079e..ff409115f 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -400,6 +400,9 @@ function display-release { function display:breaking { (( $#breaking != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + case "$output" in text) printf '\e[31m'; fmt:header "BREAKING CHANGES" 3 ;; raw) fmt:header "BREAKING CHANGES" 3 ;; @@ -427,6 +430,9 @@ function display-release { # If no commits found of type $type, go to next type (( $#hashes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "${TYPES[$type]}" 3 for hash in $hashes; do echo " - $(fmt:hash) $(fmt:scope)$(fmt:subject)" @@ -444,6 +450,9 @@ function display-release { # If no commits found under "other" types, don't display anything (( $#changes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "Other changes" 3 for hash type in ${(kv)changes}; do case "$type" in @@ -498,7 +507,7 @@ function main { # Commit classification arrays local -A types subjects scopes breaking reverts - local truncate=0 read_commits=0 + local truncate=0 read_commits=0 shown_commits=0 local version tag local hash refs subject body @@ -569,6 +578,10 @@ function main { echo " ...more commits omitted" echo fi + + if (( ! shown_commits )); then + echo "No changes to mention." + fi } # Use raw output if stdout is not a tty -- cgit v1.2.3-70-g09d2 From 7d32e7fc3fb56032252548a690744a26c3ac3059 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 13 Feb 2025 12:22:23 +0100 Subject: fix(updater): detect p10k instant prompt (#12971) Fixes #12781 --- tools/check_for_upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 1ecab5c0b..35391ea70 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -27,7 +27,7 @@ zstyle -s ':omz:update' mode update_mode || { # - $ZSH is not a git repository if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ - || [[ ! -t 1 ]] \ + || [[ ! -t 1 && ${POWERLEVEL9K_INSTANT_PROMPT:-off} == off ]] \ || ! command git --version 2>&1 >/dev/null \ || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode @@ -112,6 +112,11 @@ function update_ohmyzsh() { local verbose_mode zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default + # Force verbose mode to silent if p10k instant prompt is enabled + if [[ ${POWERLEVEL9K_INSTANT_PROMPT:-off} != "off" ]]; then + verbose_mode=silent + fi + if [[ "$update_mode" != background-alpha ]] \ && LANG= ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode; then update_last_updated_file -- cgit v1.2.3-70-g09d2 From 22ec00d1f62ffe9c5e04d6eefc49be40e082407d Mon Sep 17 00:00:00 2001 From: Gurram Siddarth Reddy <73605274+siddarthreddygsr@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:59:33 +0530 Subject: chore(install): option case matching (#12881) --- tools/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/install.sh b/tools/install.sh index e5f126915..5c9b2c18d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -399,8 +399,8 @@ EOF "$FMT_YELLOW" "$FMT_RESET" read -r opt case $opt in - y*|Y*|"") ;; - n*|N*) echo "Shell change skipped."; return ;; + [Yy]*|"") ;; + [Nn]*) echo "Shell change skipped."; return ;; *) echo "Invalid choice. Shell change skipped."; return ;; esac -- cgit v1.2.3-70-g09d2 From f81259fb344685e2dc8b67f8ad8764ccd4e8502e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 29 Mar 2025 12:55:20 +0100 Subject: fix(cli): support `noexec` environments (#13042) Closes #13032 --- lib/cli.zsh | 2 +- tools/upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/lib/cli.zsh b/lib/cli.zsh index aed86e758..3b6308313 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -193,7 +193,7 @@ EOF return 1 fi - "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" } function _omz::plugin { diff --git a/tools/upgrade.sh b/tools/upgrade.sh index c586610c4..1aa3d8af4 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -254,7 +254,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then # Print changelog to the terminal if [[ $interactive == true && $verbose_mode == default ]]; then - "$ZSH/tools/changelog.sh" HEAD "$last_commit" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" HEAD "$last_commit" fi if [[ $verbose_mode != silent ]]; then -- cgit v1.2.3-70-g09d2 From 51760e1d4aa417846b41a32ad845aaacc053a7f5 Mon Sep 17 00:00:00 2001 From: olwooz <24418404+olwooz@users.noreply.github.com> Date: Sun, 17 Aug 2025 01:29:43 +0900 Subject: feat(installer): add confirmation before overwriting existing .zshrc (#13086) --- tools/install.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/install.sh b/tools/install.sh index 5c9b2c18d..d274c2c9f 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -341,6 +341,23 @@ setup_zshrc() { echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}" return fi + + # Ask user for confirmation before backing up and overwriting + echo "${FMT_YELLOW}Found ${zdot}/.zshrc." + echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" + printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ + "$FMT_YELLOW" "$FMT_RESET" + read -r opt + case $opt in + [Yy]*|"") ;; + [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; + *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; + esac + if [ -e "$OLD_ZSHRC" ]; then OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" if [ -e "$OLD_OLD_ZSHRC" ]; then @@ -353,7 +370,7 @@ setup_zshrc() { echo "${FMT_YELLOW}Found old .zshrc.pre-oh-my-zsh." \ "${FMT_GREEN}Backing up to ${OLD_OLD_ZSHRC}${FMT_RESET}" fi - echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}" + echo "${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}" mv "$zdot/.zshrc" "$OLD_ZSHRC" fi -- cgit v1.2.3-70-g09d2 From cef64c465aa81b68fbbec5b008eeae1cb63805d3 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 19 Aug 2025 12:46:13 +0200 Subject: fix(install): ensure `--unattended` is respected (#13275) Closes #13274 --- tools/install.sh | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'tools') diff --git a/tools/install.sh b/tools/install.sh index d274c2c9f..8cf62a76e 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -25,9 +25,10 @@ # BRANCH - branch to check out immediately after install (default: master) # # Other options: -# CHSH - 'no' means the installer will not change the default shell (default: yes) -# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes) -# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no) +# CHSH - 'no' means the installer will not change the default shell (default: yes) +# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes) +# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no) +# OVERWRITE_CONFIRMATION - 'no' means the installer will not ask for confirmation to overwrite the existing .zshrc (default: yes) # # You can also pass some arguments to the install script to set some these options: # --skip-chsh: has the same behavior as setting CHSH to 'no' @@ -77,6 +78,7 @@ BRANCH=${BRANCH:-master} CHSH=${CHSH:-yes} RUNZSH=${RUNZSH:-yes} KEEP_ZSHRC=${KEEP_ZSHRC:-no} +OVERWRITE_CONFIRMATION=${OVERWRITE_CONFIRMATION:-yes} command_exists() { @@ -342,21 +344,23 @@ setup_zshrc() { return fi - # Ask user for confirmation before backing up and overwriting - echo "${FMT_YELLOW}Found ${zdot}/.zshrc." - echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." - echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" - echo "----------------------------------------" - cat "$ZSH/templates/minimal.zshrc" - echo "----------------------------------------" - printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ - "$FMT_YELLOW" "$FMT_RESET" - read -r opt - case $opt in - [Yy]*|"") ;; - [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; - *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; - esac + if [ $OVERWRITE_CONFIRMATION != "no" ]; then + # Ask user for confirmation before backing up and overwriting + echo "${FMT_YELLOW}Found ${zdot}/.zshrc." + echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" + printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ + "$FMT_YELLOW" "$FMT_RESET" + read -r opt + case $opt in + [Yy]*|"") ;; + [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; + *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; + esac + fi if [ -e "$OLD_ZSHRC" ]; then OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" @@ -510,12 +514,13 @@ main() { if [ ! -t 0 ]; then RUNZSH=no CHSH=no + OVERWRITE_CONFIRMATION=no fi # Parse arguments while [ $# -gt 0 ]; do case $1 in - --unattended) RUNZSH=no; CHSH=no ;; + --unattended) RUNZSH=no; CHSH=no; OVERWRITE_CONFIRMATION=no ;; --skip-chsh) CHSH=no ;; --keep-zshrc) KEEP_ZSHRC=yes ;; esac -- cgit v1.2.3-70-g09d2 From d3888251acae61f0ce2c7a780e97a5d2f406bd9f Mon Sep 17 00:00:00 2001 From: Paul Frederiksen Date: Fri, 19 Sep 2025 06:47:45 -0700 Subject: fix(check_for_upgrade): ensure compatibility with screen (#13302) Co-authored-by: Paul Frederiksen --- tools/check_for_upgrade.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 35391ea70..44dbb7b31 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -232,7 +232,7 @@ function handle_update() { # Ask for confirmation and only update on 'y', 'Y' or Enter # Otherwise just show a reminder for how to update - echo -n "[oh-my-zsh] Would you like to update? [Y/n] " + printf "[oh-my-zsh] Would you like to update? [Y/n] " read -r -k 1 option [[ "$option" = $'\n' ]] || echo case "$option" in @@ -280,7 +280,7 @@ case "$update_mode" in return 0 elif [[ "$EXIT_STATUS" -ne 0 ]]; then print -P "\n%F{red}[oh-my-zsh] There was an error updating:%f" - printf "\n${fg[yellow]}%s${reset_color}" "$ERROR" + printf "\n${fg[yellow]}%s${reset_color}" "${ERROR}" return 0 fi } always { -- cgit v1.2.3-70-g09d2 From 8c5a60644a2a93fb6b7d76ec7a5598f99b426cf0 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Nov 2025 21:00:26 +0100 Subject: feat: announce OpenSwag and `omz shop` command (#13428) * Update shop URLs from Planet Argon to OpenSwag and add omz shop command Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com> Co-authored-by: mcornella <1441704+mcornella@users.noreply.github.com> --- README.md | 2 +- lib/cli.zsh | 11 +++++++++++ tools/install.sh | 2 +- tools/upgrade.sh | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/README.md b/README.md index 55bfa0c5a..eaa3fb29e 100644 --- a/README.md +++ b/README.md @@ -547,7 +547,7 @@ We're on social media: ## Merchandise We have -[stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) +[stickers, shirts, and coffee mugs available](https://openswag.shop/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License diff --git a/lib/cli.zsh b/lib/cli.zsh index a002a5073..c62da36af 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -28,6 +28,7 @@ function _omz { 'plugin:Manage plugins' 'pr:Manage Oh My Zsh Pull Requests' 'reload:Reload the current zsh session' + 'shop:Open the Oh My Zsh shop' 'theme:Manage themes' 'update:Update Oh My Zsh' 'version:Show the version' @@ -173,6 +174,7 @@ Available commands: plugin Manage plugins pr Manage Oh My Zsh Pull Requests reload Reload the current zsh session + shop Open the Oh My Zsh shop theme Manage themes update Update Oh My Zsh version Show the version @@ -721,6 +723,15 @@ function _omz::pr::test { ) } +function _omz::shop { + local shop_url="https://openswag.shop/collections/oh-my-zsh" + + _omz::log info "Opening Oh My Zsh shop in your browser..." + _omz::log info "$shop_url" + + open_command "$shop_url" +} + function _omz::reload { # Delete current completion cache command rm -f $_comp_dumpfile $ZSH_COMPDUMP diff --git a/tools/install.sh b/tools/install.sh index 8cf62a76e..d86550cdd 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -505,7 +505,7 @@ print_success() { printf '\n' printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)" - printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" + printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "OpenSwag Shop" https://openswag.shop/collections/oh-my-zsh)" printf '%s\n' $FMT_RESET } diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 1aa3d8af4..82c0624bc 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -273,7 +273,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then printf "${BLUE}%s${RESET}\n\n" "$message" printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on X:" "$(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)" - printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)" + printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "OpenSwag Shop" https://openswag.shop/collections/oh-my-zsh)" elif [[ $verbose_mode == minimal ]]; then printf "${BLUE}%s${RESET}\n" "$message" fi -- cgit v1.2.3-70-g09d2 From b52dd1a425e9ed9f844ba46cd27ff94a3b4949dc Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 17:44:11 -0800 Subject: feat: Update OpenSwag domain references to CommitGoods (#13434) * Initial plan * Update all OpenSwag domain references to CommitGoods Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com> --- README.md | 2 +- lib/cli.zsh | 2 +- tools/install.sh | 2 +- tools/upgrade.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/README.md b/README.md index eaa3fb29e..2ccb63b69 100644 --- a/README.md +++ b/README.md @@ -547,7 +547,7 @@ We're on social media: ## Merchandise We have -[stickers, shirts, and coffee mugs available](https://openswag.shop/collections/oh-my-zsh?utm_source=github) +[stickers, shirts, and coffee mugs available](https://commitgoods.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License diff --git a/lib/cli.zsh b/lib/cli.zsh index c62da36af..55938ba8a 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -724,7 +724,7 @@ function _omz::pr::test { } function _omz::shop { - local shop_url="https://openswag.shop/collections/oh-my-zsh" + local shop_url="https://commitgoods.com/collections/oh-my-zsh" _omz::log info "Opening Oh My Zsh shop in your browser..." _omz::log info "$shop_url" diff --git a/tools/install.sh b/tools/install.sh index d86550cdd..c31ce2d55 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -505,7 +505,7 @@ print_success() { printf '\n' printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)" - printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "OpenSwag Shop" https://openswag.shop/collections/oh-my-zsh)" + printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "CommitGoods Shop" https://commitgoods.com/collections/oh-my-zsh)" printf '%s\n' $FMT_RESET } diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 82c0624bc..01719d217 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -273,7 +273,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then printf "${BLUE}%s${RESET}\n\n" "$message" printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on X:" "$(fmt_link @ohmyzsh https://x.com/ohmyzsh)" printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)" - printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "OpenSwag Shop" https://openswag.shop/collections/oh-my-zsh)" + printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "CommitGoods Shop" https://commitgoods.com/collections/oh-my-zsh)" elif [[ $verbose_mode == minimal ]]; then printf "${BLUE}%s${RESET}\n" "$message" fi -- cgit v1.2.3-70-g09d2