Diff
1diff --git a/.github/dependencies.yml b/.github/dependencies.yml
2index 23168b91ac0ad61cc9c27f9e603458aadbf7976b..b67a4c7edc9fc43bce8796c2b267bfa964bbd91e 100644
3--- a/.github/dependencies.yml
4+++ b/.github/dependencies.yml
5@@ -30,7 +30,7 @@ dependencies:
6 plugins/wd:
7 repo: mfaerevaag/wd
8 branch: master
9- version: tag:v0.10.0
10+ version: tag:v0.10.1
11 precopy: |
12 set -e
13 rm -r test
14diff --git a/plugins/wd/README.md b/plugins/wd/README.md
15index b345d65f574231ce0e427203e74ae8677601a2dc..1240afe579cbd22106e4b7c8ab3ed2626f3b20b9 100644
16--- a/plugins/wd/README.md
17+++ b/plugins/wd/README.md
18@@ -65,12 +65,9 @@ Add the following to your `home.nix` then run `home-manager switch`:
19 programs.zsh.plugins = [
20 {
21 name = "wd";
22- src = pkgs.fetchFromGitHub {
23- owner = "mfaerevaag";
24- repo = "wd";
25- rev = "v0.5.2";
26- sha256 = "sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg=";
27- };
28+ src = pkgs.zsh-wd;
29+ file = "share/wd/wd.plugin.zsh";
30+ completions = [ "share/zsh/site-functions" ];
31 }
32 ];
33 ```
34diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
35index f7a22ff7dee921a37d4ee7154c0247d4884af65b..56c029252ba065926a4dc3206a0846dc58245c3d 100755
36--- a/plugins/wd/wd.sh
37+++ b/plugins/wd/wd.sh
38@@ -8,7 +8,7 @@
39 # @github.com/mfaerevaag/wd
40
41 # version
42-readonly WD_VERSION=0.10.0
43+readonly WD_VERSION=0.10.1
44
45 # colors
46 readonly WD_BLUE="\033[96m"
47@@ -174,6 +174,11 @@ wd_add()
48 point=$(basename "$PWD")
49 fi
50
51+ if [ ! -w "$wd_config_file" ]; then
52+ wd_exit_fail "\'$wd_config_file\' is not writeable."
53+ return
54+ fi
55+
56 if [[ $point =~ "^[\.]+$" ]]
57 then
58 wd_exit_fail "Warp point cannot be just dots"
59@@ -239,6 +244,11 @@ wd_remove()
60 point_list=$(basename "$PWD")
61 fi
62
63+ if [ ! -w "$wd_config_file" ]; then
64+ wd_exit_fail "\'$wd_config_file\' is not writeable."
65+ return
66+ fi
67+
68 for point_name in $point_list ; do
69 if [[ ${points[$point_name]} != "" ]]
70 then
71@@ -440,6 +450,11 @@ wd_clean() {
72 local count=0
73 local wd_tmp=""
74
75+ if [ ! -w "$wd_config_file" ]; then
76+ wd_exit_fail "\'$wd_config_file\' is not writeable."
77+ return
78+ fi
79+
80 while read -r line
81 do
82 if [[ $line != "" ]]
83@@ -543,14 +558,6 @@ args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,open:,path:,help,show -- $
84 if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]]
85 then
86 wd_print_usage
87-
88-# check if config file is writeable
89-elif [ ! -w "$wd_config_file" ]
90-then
91- # do nothing
92- # can't run `exit`, as this would exit the executing shell
93- wd_exit_fail "\'$wd_config_file\' is not writeable."
94-
95 else
96 # parse rest of options
97 local wd_o