Skip to content

Commit c8dc280

Browse files
committed
fix: Do not add folders to bin at root of directory
1 parent 0ff36d1 commit c8dc280

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

pkg/lib/util/abstract-bins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ abstract.bins_search_heuristics() {
8484
done
8585
else
8686
for file in "$BPM_PACKAGES_PATH/$id"/*; do
87-
if [ -x "$file" ]; then
87+
if [[ -f "$file" && -x "$file" ]]; then
8888
abstract.bins_do_action "$action" "$file" "$remove_extensions"
8989
fi
9090
done

tests/do-plumbing-link-bins.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ load 'util/init.sh'
170170
assert [ ! -e "$BPM_INSTALL_BIN/exec4.sh" ]
171171
}
172172

173+
@test "does not add directories in root directory" {
174+
local site='github.com'
175+
local pkg='username/package'
176+
177+
test_util.setup_pkg "$pkg"; {
178+
mkdir 'directory1'
179+
touch 'directory1/.gitkeep'
180+
}; test_util.finish_pkg
181+
test_util.mock_clone "$pkg" "$site/$pkg"
182+
183+
run do-plumbing-link-bins "$site/$pkg"
184+
185+
assert_success
186+
assert [ ! -e "$BPM_INSTALL_BIN/directory1" ]
187+
}
188+
173189
@test "doesn't link root bins if there is a bin folder" {
174190
local site='github.com'
175191
local pkg="username/package"

0 commit comments

Comments
 (0)