Skip to content

Commit

Permalink
add logic to kill wing gen-docs after 2 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Aug 30, 2024
1 parent 661c046 commit da5d494
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions k8s/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
echo "Compiling..."
wing compile .
echo "Generating docs..."
timeout 5s 'DEBUG="*" wing gen-docs'

if [ $? -eq 124 ]; then
echo "Command timed out after 5 seconds"
exit 1
( DEBUG="*" wing gen-docs ) & pid=$!
( sleep 2 && kill -HUP $pid ) 2>/dev/null & watcher=$!
if wait $pid 2>/dev/null; then
echo "your_command finished"
pkill -HUP -P $watcher
wait $watcher
else
echo "your_command interrupted"
fi

0 comments on commit da5d494

Please sign in to comment.