6f1036293cdc1af12dbe6390a061c147de1196ff

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

refactor(copydir)!: deprecate plugin in favor of `copypath`

BREAKING CHANGE: the `copydir` plugin is deprecated. Instead of
using `copydir`, use `copypath` which also supports copying
the path of other files or directories specified.

Diff

 1diff --git a/plugins/copydir/README.md b/plugins/copydir/README.md
 2index 594bf10657935722a3bafe7b331ee26dc175628e..cf24b789f4020763730c635c545eccbd34fbe4e8 100644
 3--- a/plugins/copydir/README.md
 4+++ b/plugins/copydir/README.md
 5@@ -1,10 +1,3 @@
 6 # copydir plugin
 7 
 8-Copies the path of your current folder to the system clipboard.
 9-
10-To use, add `copydir` to your plugins array:
11-```
12-plugins=(... copydir)
13-```
14-
15-Then use the command `copydir` to copy the $PWD.
16+This plugin is deprecated. Use the [`copypath` plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/copypath) instead.
17diff --git a/plugins/copydir/copydir.plugin.zsh b/plugins/copydir/copydir.plugin.zsh
18index c451062406a0a3fab62728e673c94f6cab5b396c..a2b489ec040864704f58fe3eb09bfa2a9b8733f7 100644
19--- a/plugins/copydir/copydir.plugin.zsh
20+++ b/plugins/copydir/copydir.plugin.zsh
21@@ -1,5 +1,7 @@
22-# Copies the pathname of the current directory to the system or X Windows clipboard
23+echo ${(%):-'%F{yellow}The `%Bcopydir%b` plugin is deprecated. Use the `%Bcopypath%b` plugin instead.%f'}
24+source "$ZSH/plugins/copypath/copypath.plugin.zsh"
25+
26+# TODO: 2022-02-22: Remove deprecated copydir function.
27 function copydir {
28-  emulate -L zsh
29-  print -n $PWD | clipcopy
30+  copypath
31 }