File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ should_reshim() {
22
22
fi
23
23
24
24
local is_global= cmd= cmd_needs_reshim=
25
+ local additional_bare_cmds=()
25
26
26
27
for arg; do
27
28
case " $arg " in
@@ -32,7 +33,11 @@ should_reshim() {
32
33
-* ) ;; # Skip other options
33
34
34
35
* )
35
- cmd=" ${cmd:- $arg } "
36
+ if ! [ " $cmd " ]; then
37
+ cmd=" $arg "
38
+ else
39
+ additional_bare_cmds+=(" $arg " )
40
+ fi
36
41
;;
37
42
esac
38
43
done
@@ -47,6 +52,20 @@ should_reshim() {
47
52
uninstall|un|unlink|remove|rm|r)
48
53
cmd_needs_reshim=true
49
54
;;
55
+
56
+ link|ln)
57
+ # Bare link installs a global package
58
+ if ! [ " ${additional_bare_cmds[0]-} " ]; then
59
+ is_global=1
60
+ cmd_needs_reshim=true
61
+ fi
62
+
63
+ # Links to directories also install a global package
64
+ if [[ " ${additional_bare_cmds[0]-} " =~ [./].* && -d " ${additional_bare_cmds[0]-} " ]]; then
65
+ is_global=1
66
+ cmd_needs_reshim=true
67
+ fi
68
+ ;;
50
69
esac
51
70
52
71
# Implicit return
You can’t perform that action at this time.
0 commit comments