Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit dc754c4

Browse files
committed
fix: improve error handling in bin/pack.sh
Fixes #2979
1 parent d8b324c commit dc754c4

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

bin/pack.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
#!/usr/bin/env bash
22

3-
if [ ! -d /tmp/kui-packs ]; then
4-
mkdir /tmp/kui-packs
5-
else
6-
rm -f /tmp/kui-packs/*
7-
fi
3+
rm -rf /tmp/kui-packs && mkdir /tmp/kui-packs
84

95
for i in plugins/*; do
106
if [ -d $i ]; then
117
echo "$(tput setaf 8)packing $(basename $i)$(tput sgr0)"
12-
(cd $i && npm pack >& /dev/null && mv kui-shell*.tgz /tmp/kui-packs) &
8+
(cd $i && npm pack > /dev/null 2>> /tmp/kui-packs.err && mv kui-shell*.tgz /tmp/kui-packs) &
139
fi
1410
done
1511

1612
for i in packages/*; do
1713
if [ -d $i ]; then
1814
echo "$(tput setaf 8)packing $(basename $i)$(tput sgr0)"
19-
(cd $i && npm pack >& /dev/null && mv kui-shell*.tgz /tmp/kui-packs) &
15+
(cd $i && npm pack > /dev/null 2>> /tmp/kui-packs.err && mv kui-shell*.tgz /tmp/kui-packs) &
2016
fi
2117
done
2218

2319
wait
20+
CODE=$?
21+
22+
if [ $CODE != 0 ]; then
23+
echo "Error generating packs. You will find the error logs in /tmp/kui-packs.err"
24+
if [ -n "$TRAVIS_JOB_ID" ]; then
25+
cat /tmp/kui-packs.err
26+
fi
27+
fi
28+
29+
if [ -n "$TRAVIS_JOB_ID" ]; then
30+
echo "Generated these packs:"
31+
ls -l /tmp/kui-packs/
32+
fi
2433

2534
for i in /tmp/kui-packs/*.tgz; do
2635
mv $i ${i//-[[:digit:]].[[:digit:]].[[:digit:]]}
2736
done
2837

2938
echo "$(tput setaf 2)done:$(tput sgr0) packs generated in /tmp/kui-packs"
39+
40+
exit $CODE

tools/travis/test/target.d/webpack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ popd
8888
# we expect "docker not found" error on travis osx
8989
# we still want to test the webpack build logic before building docker image
9090
#
91-
echo "building external clients"
91+
echo "building external client"
9292
./clients/bin/mkclient.sh
9393

9494
echo "starting webpack dev server"

0 commit comments

Comments
 (0)