Skip to content

Commit e51b9a8

Browse files
committed
ros-generate-cache.sh: Add error checking
Signed-off-by: Rob Woolley <[email protected]>
1 parent 1e4842c commit e51b9a8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/ros-generate-cache.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ if [ "$ROS_DISTRO" = "dashing" -o "$ROS_DISTRO" = "eloquent" ] ; then
123123
fi
124124

125125
rosdistro_build_cache --debug --preclean --ignore-local $tmpdir/index-v4.yaml $ROS_DISTRO
126+
if [ $? -ne 0 ]; then
127+
echo "ABORT: rosdistro_build_cache returned a runtime error"
128+
exit 1
129+
fi
130+
131+
if [ ! -f $tmpdir/index-v4.yaml ]; then
132+
echo "ABORT: $tmpdir/index-v4.yaml could not be found."
133+
exit 1
134+
fi
135+
136+
if [ ! -f $tmpdir/$ROS_DISTRO-cache.yaml.gz ]; then
137+
echo "ABORT: $tmpdir/$ROS_DISTRO-cache.yaml.gz could not be found."
138+
exit 1
139+
fi
126140

127141
cd - > /dev/null
128142

0 commit comments

Comments
 (0)