366d25435229bfa725109a147d6cb2fef8011b3c

Author
ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(wd): update to v0.9.2 (#12820)

Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>

Diff

This diff is truncated to protect this page.

  1diff --git a/.github/dependencies.yml b/.github/dependencies.yml
  2index d53b0cd4dd8f79402a90aac992c01d5a70ced511..603bf7566c4d8b90342dcbd30e2fe31da6c3d05d 100644
  3--- a/.github/dependencies.yml
  4+++ b/.github/dependencies.yml
  5@@ -28,7 +28,7 @@ dependencies:
  6   plugins/wd:
  7     repo: mfaerevaag/wd
  8     branch: master
  9-    version: tag:v0.9.1
 10+    version: tag:v0.9.2
 11     precopy: |
 12       set -e
 13       rm -r test
 14diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
 15index 66435a2a6aa1d7c4791d552033dcb63c5d09c56b..962ad9afa22f2615af9bf4c9d8b1b34fdddf3302 100755
 16--- a/plugins/wd/wd.sh
 17+++ b/plugins/wd/wd.sh
 18@@ -8,7 +8,7 @@
 19 # @github.com/mfaerevaag/wd
 20 
 21 # version
 22-readonly WD_VERSION=0.9.1
 23+readonly WD_VERSION=0.9.2
 24 
 25 # colors
 26 readonly WD_BLUE="\033[96m"
 27@@ -145,14 +145,17 @@ wd_warp()
 28         else
 29             (( n = $#1 - 1 ))
 30             cd -$n > /dev/null
 31+            WD_EXIT_CODE=$?
 32         fi
 33     elif [[ ${points[$point]} != "" ]]
 34     then
 35         if [[ $sub != "" ]]
 36         then
 37             cd ${points[$point]/#\~/$HOME}/$sub
 38+            WD_EXIT_CODE=$?
 39         else
 40             cd ${points[$point]/#\~/$HOME}
 41+            WD_EXIT_CODE=$?
 42         fi
 43     else
 44         wd_exit_fail "Unknown warp point '${point}'"
 45@@ -185,11 +188,11 @@ wd_add()
 46     elif [[ ${points[$point]} == "" ]] || [ ! -z "$force" ]
 47     then
 48         wd_remove "$point" > /dev/null
 49-        printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> "$WD_CONFIG"
 50+        printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> "$wd_config_file"
 51         if (whence sort >/dev/null); then
 52             local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
 53-            # use 'cat' below to ensure we respect $WD_CONFIG as a symlink
 54-            command sort -o "${config_tmp}" "$WD_CONFIG" && command cat "${config_tmp}" >| "$WD_CONFIG" && command rm "${config_tmp}"
 55+            # use 'cat' below to ensure we respect $wd_config_file as a symlink
 56+            command sort -o "${config_tmp}" "$wd_config_file" && command cat "${config_tmp}" >| "$wd_config_file" && command rm "${config_tmp}"
 57         fi
 58 
 59         wd_export_static_named_directories
 60@@ -240,7 +243,7 @@ wd_remove()
 61         then
 62             local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
 63             # Copy and delete in two steps in order to preserve symlinks
 64-            if sed -n "/^${point_name}:.*$/!p" "$WD_CONFIG" >| "$config_tmp" && command cp "$config_tmp" "$WD_CONFIG" && command rm "$config_tmp"
 65+            if sed -n "/^${point_name}:.*$/!p" "$wd_config_file" >| "$config_tmp" && command cp "$config_tmp" "$wd_config_file" && command rm "$config_tmp"
 66             then
 67                 wd_print_msg "$WD_GREEN" "Warp point removed"
 68             else
 69@@ -257,7 +260,7 @@ wd_browse() {
 70         echo "This functionality requires fzf. Please install fzf first."
 71         return 1
 72     fi
 73-    local entries=("${(@f)$(sed "s:${HOME}:~:g" "$WD_CONFIG" | awk -F ':' '{print $1 " -> " $2}')}")
 74+    local entries=("${(@f)$(sed "s:${HOME}:~:g" "$wd_config_file" | awk -F ':' '{print $1 " -> " $2}')}")
 75     local script_path="${${(%):-%x}:h}"
 76     local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
 77     entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}")
 78@@ -275,7 +278,7 @@ wd_browse() {
 79 }
 80 
 81 wd_browse_widget() {
 82-  if [[ -e $WD_CONFIG ]]; then
 83+  if [[ -e $wd_config_file ]]; then
 84     wd_browse
 85     saved_buffer=$BUFFER
 86     saved_cursor=$CURSOR
 87@@ -298,7 +301,7 @@ wd_list_all()
 88 {
 89     wd_print_msg "$WD_BLUE" "All warp points:"
 90 
 91-    entries=$(sed "s:${HOME}:~:g" "$WD_CONFIG")
 92+    entries=$(sed "s:${HOME}:~:g" "$wd_config_file")
 93 
 94     max_warp_point_length=0
 95     while IFS= read -r line
 96@@ -398,7 +401,7 @@ wd_clean() {
 97                 count=$((count+1))
 98             fi
 99         fi
100-    done < "$WD_CONFIG"
101+    done < "$wd_config_file"
102 
103     if [[ $count -eq 0 ]]
104     then
105@@ -406,7 +409,7 @@ wd_clean() {
106     else
107         if [ ! -z "$force" ] || wd_yesorno "Removing ${count} warp points. Continue? (y/n)"
108         then
109-            echo "$wd_tmp" >! "$WD_CONFIG"
110+            echo "$wd_tmp" >! "$wd_config_file"
111             wd_print_msg "$WD_GREEN" "Cleanup complete. ${count} warp point(s) removed"
112         else
113             wd_print_msg "$WD_BLUE" "Cleanup aborted"
114@@ -417,7 +420,7 @@ wd_clean() {
115 wd_export_static_named_directories() {
116   if [[ ! -z $WD_EXPORT ]]
117   then