1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-20 00:47:45 +08:00

Compare commits

..

No commits in common. "9bfa3395f34f63d14945e01c45c72ec43d372dfa" and "d2d5155d41cbe183ef172fef1e83a29d116a5af6" have entirely different histories.

3 changed files with 8 additions and 9 deletions

View File

@ -28,7 +28,7 @@ dependencies:
plugins/wd: plugins/wd:
repo: mfaerevaag/wd repo: mfaerevaag/wd
branch: master branch: master
version: tag:v0.9.1 version: tag:v0.9.0
precopy: | precopy: |
set -e set -e
rm -r test rm -r test

View File

@ -1,5 +1,5 @@
certifi==2024.8.30 certifi==2024.8.30
charset-normalizer==3.4.0 charset-normalizer==3.3.2
idna==3.10 idna==3.10
PyYAML==6.0.2 PyYAML==6.0.2
requests==2.32.3 requests==2.32.3

View File

@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd # @github.com/mfaerevaag/wd
# version # version
readonly WD_VERSION=0.9.1 readonly WD_VERSION=0.9.0
# colors # colors
readonly WD_BLUE="\033[96m" readonly WD_BLUE="\033[96m"
@ -59,7 +59,7 @@ wd_print_msg()
then then
local color="${1:-$WD_BLUE}" # Default to blue if no color is provided local color="${1:-$WD_BLUE}" # Default to blue if no color is provided
local msg="$2" local msg="$2"
if [[ -z "$msg" ]]; then if [[ -z "$msg" ]]; then
print "${WD_RED}*${WD_NOC} Could not print message. Sorry!" print "${WD_RED}*${WD_NOC} Could not print message. Sorry!"
else else
@ -344,7 +344,6 @@ wd_path()
wd_show() wd_show()
{ {
local name_arg=$1 local name_arg=$1
local show_pwd
# if there's an argument we look up the value # if there's an argument we look up the value
if [[ -n $name_arg ]] if [[ -n $name_arg ]]
then then
@ -359,12 +358,12 @@ wd_show()
local wd_matches local wd_matches
wd_matches=() wd_matches=()
# do a reverse lookup to check whether PWD is in $points # do a reverse lookup to check whether PWD is in $points
show_pwd="${PWD/$HOME/~}" PWD="${PWD/$HOME/~}"
if [[ ${points[(r)$show_pwd]} == "$show_pwd" ]] if [[ ${points[(r)$PWD]} == "$PWD" ]]
then then
for name in ${(k)points} for name in ${(k)points}
do do
if [[ $points[$name] == "$show_pwd" ]] if [[ $points[$name] == "$PWD" ]]
then then
wd_matches[$(($#wd_matches+1))]=$name wd_matches[$(($#wd_matches+1))]=$name
fi fi
@ -372,7 +371,7 @@ wd_show()
wd_print_msg "$WD_BLUE" "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}" wd_print_msg "$WD_BLUE" "$#wd_matches warp point(s) to current directory: ${WD_GREEN}$wd_matches${WD_NOC}"
else else
wd_print_msg "$WD_YELLOW" "No warp point to $show_pwd" wd_print_msg "$WD_YELLOW" "No warp point to $(echo "$PWD" | sed "s:$HOME:~:")"
fi fi
fi fi
} }