Skip to content

Commit 9f5bdf5

Browse files
committed
Add positional argument to test/smoke.sh script
1 parent 651ead6 commit 9f5bdf5

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎pkgs/core/scripts/test/smoke.sh‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@ scripts/build/package.sh
1414
cd "$dir" || exit 1
1515
pnpm install
1616

17-
for example in `ls`
17+
if [ -n "$1" ]; then
18+
examples="$1"
19+
else
20+
examples="$(ls)"
21+
fi
22+
23+
for example in $examples
1824
do
1925
if [ ! -f "$example/package.json" ]; then
26+
if [ -n "$1" ]; then
27+
printf "$error_message"
28+
printf "Example '$example' does not exist or has no package.json\n"
29+
exit 1
30+
fi
2031
continue
2132
fi
33+
2234
printf "\n\033[0;32mTesting $example...\033[0m\n\n"
2335
cd "$example" || exit 1
2436
pnpm run build

0 commit comments

Comments
 (0)