浏览代码

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.
Jonathan Batchelor 2 年之前
父节点
当前提交
b2f35a7b98
共有 8 个文件被更改,包括 17 次插入9 次删除
  1. 1 1
      README.md
  2. 4 4
      plugins/osx/README.md
  3. 0 0
      plugins/macos/_security
  4. 10 4
      plugins/osx/osx.plugin.zsh
  5. 0 0
      plugins/macos/music
  6. 1 0
      plugins/macos/osx.plugin.zsh
  7. 0 0
      plugins/macos/spotify
  8. 1 0
      plugins/osx

+ 1 - 1
README.md

@@ -68,7 +68,7 @@ plugins=(
   git
   git
   bundler
   bundler
   dotenv
   dotenv
-  osx
+  macos
   rake
   rake
   rbenv
   rbenv
   ruby
   ruby

+ 4 - 4
plugins/osx/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).
 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
 ```zsh
-plugins=(... osx)
+plugins=(... macos)
 ```
 ```
 
 
 Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
 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         |
 | `itunes`      | _DEPRECATED_. Use `music` from macOS Catalina on         |
 | `music`       | Control Apple Music. Use `music -h` for usage details    |
 | `music`       | Control Apple Music. Use `music -h` for usage details    |
 | `spotify`     | Control Spotify and search by artist, album, track…      |
 | `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                             |
 | `btrestart`   | Restart the Bluetooth daemon                             |
 | `freespace`   | Erases purgeable disk space with 0s on the selected disk |
 | `freespace`   | Erases purgeable disk space with 0s on the selected disk |
 
 

plugins/osx/_security → plugins/macos/_security


+ 10 - 4
plugins/osx/osx.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
 # Open the current directory in a Finder window
 alias ofd='open_command $PWD'
 alias ofd='open_command $PWD'
 
 
@@ -11,7 +17,7 @@ function btrestart() {
   sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
   sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
 }
 }
 
 
-function _omz_osx_get_frontmost_app() {
+function _omz_macos_get_frontmost_app() {
   osascript 2>/dev/null <<EOF
   osascript 2>/dev/null <<EOF
     tell application "System Events"
     tell application "System Events"
       name of first item of (every process whose frontmost is true)
       name of first item of (every process whose frontmost is true)
@@ -24,7 +30,7 @@ function tab() {
   local command="cd \\\"$PWD\\\"; clear"
   local command="cd \\\"$PWD\\\"; clear"
   (( $# > 0 )) && command="${command}; $*"
   (( $# > 0 )) && command="${command}; $*"
 
 
-  local the_app=$(_omz_osx_get_frontmost_app)
+  local the_app=$(_omz_macos_get_frontmost_app)
 
 
   if [[ "$the_app" == 'Terminal' ]]; then
   if [[ "$the_app" == 'Terminal' ]]; then
     # Discarding stdout to quash "tab N of window id XXX" output
     # Discarding stdout to quash "tab N of window id XXX" output
@@ -77,7 +83,7 @@ function vsplit_tab() {
   local command="cd \\\"$PWD\\\"; clear"
   local command="cd \\\"$PWD\\\"; clear"
   (( $# > 0 )) && command="${command}; $*"
   (( $# > 0 )) && command="${command}; $*"
 
 
-  local the_app=$(_omz_osx_get_frontmost_app)
+  local the_app=$(_omz_macos_get_frontmost_app)
 
 
   if [[ "$the_app" == 'iTerm' ]]; then
   if [[ "$the_app" == 'iTerm' ]]; then
     osascript <<EOF
     osascript <<EOF
@@ -125,7 +131,7 @@ function split_tab() {
   local command="cd \\\"$PWD\\\"; clear"
   local command="cd \\\"$PWD\\\"; clear"
   (( $# > 0 )) && command="${command}; $*"
   (( $# > 0 )) && command="${command}; $*"
 
 
-  local the_app=$(_omz_osx_get_frontmost_app)
+  local the_app=$(_omz_macos_get_frontmost_app)
 
 
   if [[ "$the_app" == 'iTerm' ]]; then
   if [[ "$the_app" == 'iTerm' ]]; then
     osascript 2>/dev/null <<EOF
     osascript 2>/dev/null <<EOF

plugins/osx/music → plugins/macos/music


+ 1 - 0
plugins/macos/osx.plugin.zsh

@@ -0,0 +1 @@
+macos.plugin.zsh

plugins/osx/spotify → plugins/macos/spotify


+ 1 - 0
plugins/osx

@@ -0,0 +1 @@
+macos