From b2f35a7b98455b2bb8c7c3b11db6aa587e1d28bf Mon Sep 17 00:00:00 2001 From: Jonathan Batchelor Date: Fri, 5 Nov 2021 23:40:38 +0000 Subject: [PATCH] refactor(osx): Rename osx plugin to macos (#10341) Apple changed the name of their operating system from OS X to macOS a number of years ago. This was overdue! As per issue #10311 * refactor(osx): rename `osx` plugin to `macos` * refactor(macos): Add symbolic link from old `osx` plugin name. --- README.md | 2 +- plugins/{osx => macos}/README.md | 8 ++++---- plugins/{osx => macos}/_security | 0 .../{osx/osx.plugin.zsh => macos/macos.plugin.zsh} | 14 ++++++++++---- plugins/{osx => macos}/music | 0 plugins/macos/osx.plugin.zsh | 1 + plugins/{osx => macos}/spotify | 0 plugins/osx | 1 + 8 files changed, 17 insertions(+), 9 deletions(-) rename plugins/{osx => macos}/README.md (94%) rename plugins/{osx => macos}/_security (100%) rename plugins/{osx/osx.plugin.zsh => macos/macos.plugin.zsh} (93%) rename plugins/{osx => macos}/music (100%) create mode 120000 plugins/macos/osx.plugin.zsh rename plugins/{osx => macos}/spotify (100%) create mode 120000 plugins/osx diff --git a/README.md b/README.md index 907248beb..5712c1701 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ plugins=( git bundler dotenv - osx + macos rake rbenv ruby diff --git a/plugins/osx/README.md b/plugins/macos/README.md similarity index 94% rename from plugins/osx/README.md rename to plugins/macos/README.md index 50458f60e..1bc4244a4 100644 --- a/plugins/osx/README.md +++ b/plugins/macos/README.md @@ -1,11 +1,11 @@ -# OSX plugin +# MacOS plugin This plugin provides a few utilities to make it more enjoyable on macOS (previously named OSX). -To start using it, add the `osx` plugin to your plugins array in `~/.zshrc`: +To start using it, add the `macos` plugin to your plugins array in `~/.zshrc`: ```zsh -plugins=(... osx) +plugins=(... macos) ``` Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) @@ -31,7 +31,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) | `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on | | `music` | Control Apple Music. Use `music -h` for usage details | | `spotify` | Control Spotify and search by artist, album, trackā€¦ | -| `rmdsstore` | Remove .DS\_Store files recursively in a directory | +| `rmdsstore` | Remove .DS_Store files recursively in a directory | | `btrestart` | Restart the Bluetooth daemon | | `freespace` | Erases purgeable disk space with 0s on the selected disk | diff --git a/plugins/osx/_security b/plugins/macos/_security similarity index 100% rename from plugins/osx/_security rename to plugins/macos/_security diff --git a/plugins/osx/osx.plugin.zsh b/plugins/macos/macos.plugin.zsh similarity index 93% rename from plugins/osx/osx.plugin.zsh rename to plugins/macos/macos.plugin.zsh index 16f16ddb6..4bcbbaead 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -1,3 +1,9 @@ +# Check if 'osx' is still in the plugins list and prompt to change to 'macos' +if [[ -n "${plugins[(r)osx]}" ]]; then + print ${(%):-"%F{yellow}The \`osx\` plugin is deprecated and has been renamed to \`macos\`."} + print ${(%):-"Please update your .zshrc to use the \`%Bmacos%b\` plugin instead.%f"} +fi + # Open the current directory in a Finder window alias ofd='open_command $PWD' @@ -11,7 +17,7 @@ function btrestart() { sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport } -function _omz_osx_get_frontmost_app() { +function _omz_macos_get_frontmost_app() { osascript 2>/dev/null < 0 )) && command="${command}; $*" - local the_app=$(_omz_osx_get_frontmost_app) + local the_app=$(_omz_macos_get_frontmost_app) if [[ "$the_app" == 'Terminal' ]]; then # Discarding stdout to quash "tab N of window id XXX" output @@ -77,7 +83,7 @@ function vsplit_tab() { local command="cd \\\"$PWD\\\"; clear" (( $# > 0 )) && command="${command}; $*" - local the_app=$(_omz_osx_get_frontmost_app) + local the_app=$(_omz_macos_get_frontmost_app) if [[ "$the_app" == 'iTerm' ]]; then osascript < 0 )) && command="${command}; $*" - local the_app=$(_omz_osx_get_frontmost_app) + local the_app=$(_omz_macos_get_frontmost_app) if [[ "$the_app" == 'iTerm' ]]; then osascript 2>/dev/null <