Skip to content

Commit 9bf4847

Browse files
committed
- Fix rush show to not break when the package contains directories
1 parent 664039d commit 9bf4847

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

rush

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,10 +1622,12 @@ rush_show_command() {
16221622
else
16231623
shopt -s dotglob
16241624
for f in "$package_path"/*; do
1625-
green "$(basename "$f")"
1626-
cat "$f"
1627-
echo
1628-
echo
1625+
if [[ -f "$f" ]]; then
1626+
green "$(basename "$f")"
1627+
cat "$f"
1628+
echo
1629+
echo
1630+
fi
16291631
done
16301632
shopt -u dotglob
16311633
fi

src/show_command.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ if [[ $file ]]; then
2323
else
2424
shopt -s dotglob
2525
for f in "$package_path"/*; do
26-
green "$(basename "$f")"
27-
cat "$f"
28-
echo
29-
echo
26+
if [[ -f "$f" ]]; then
27+
green "$(basename "$f")"
28+
cat "$f"
29+
echo
30+
echo
31+
fi
3032
done
3133
shopt -u dotglob
3234
fi

test/approvals/rush_show_nested

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
info
2+
Nested packages (show with 'rush list nested')

test/approve

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ describe "show"
138138
approve "rush show -h"
139139
approve "rush show download"
140140
approve "rush show download main"
141+
approve "rush show nested"
141142

142143
describe "copy"
143144
mkdir ~/rush-repos/target

0 commit comments

Comments
 (0)