Skip to content

Commit 9f09867

Browse files
committed
feat: Warn when trying to add directories that are absolute paths
An absolute path is tested for because we still want global installs to work when the user is in the 'cellar/packages' folder
1 parent b0c4cdf commit 9f09867

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/lib/commands/do-add.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ do-add() {
2020
fi
2121

2222
for repoSpec in "${pkgs[@]}"; do
23+
if [[ -d "$repoSpec" && "${repoSpec::1}" == / ]]; then
24+
log.warn "Identifier '$repoSpec' is a directory, not a package. Skipping"
25+
continue
26+
fi
27+
2328
util.extract_data_from_input "$repoSpec" "$with_ssh"
2429
local uri="$REPLY1"
2530
local site="$REPLY2"

0 commit comments

Comments
 (0)