File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ Options:
209
209
Info provided per symlink:
210
210
- target, recursively
211
211
- (if relative: canonical path)
212
+ - (if broken: warning)
212
213
213
214
Exit Status:
214
215
3 - Invalid options
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ Options:
19
19
Info provided per symlink:
20
20
- target, recursively
21
21
- (if relative: canonical path)
22
+ - (if broken: warning)
22
23
23
24
Exit Status:
24
25
3 - Invalid options
@@ -58,7 +59,7 @@ while getopts :hv OPT; do
58
59
exit 0
59
60
;;
60
61
v)
61
- echo " symlink-info 0.2.2 "
62
+ echo " symlink-info 0.3.0 "
62
63
exit 0
63
64
;;
64
65
* )
@@ -111,6 +112,13 @@ for path; do
111
112
_indent 1
112
113
printf ' canonical path: %s\n' " $path_canonical "
113
114
fi
115
+
116
+ if [[ ! -e $path_canonical ]]; then
117
+ printf >&2 " %s: Warning: Broken symlink. Target does not exist: %s\n" \
118
+ " $basename " \
119
+ " $path_canonical "
120
+ exit=1
121
+ fi
114
122
done
115
123
116
124
exit $exit
You can’t perform that action at this time.
0 commit comments