Skip to content

Commit

Permalink
[SLUG] Transferring changes from Slug as of 2023-04-21 06:55:32 +0100.
Browse files Browse the repository at this point in the history
  • Loading branch information
neoeno committed Apr 21, 2023
1 parent d8491bc commit 273fa71
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions lib/python
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ if [[ "$@" == *"-i"* ]] || [[ "$@" == *"--interactive"* ]] || [[ "$@" == "" ]];
echo -e " ${NC}exit()${BLUE}"
echo -e "Do the same thing if you run into weird errors.${NC}"
echo
fi

timeout 5 $HOME/$REPL_SLUG/venv/bin/python $@
$HOME/$REPL_SLUG/venv/bin/python $@
else
timeout 5 $HOME/$REPL_SLUG/venv/bin/python $@

if [[ $? == 124 ]]; then
echo -e "${BLUE}Your program took quite a while to run."
echo "So I've stopped it for you."
echo "You can try running it again if you like."
echo
echo "If you're on the 'while' material, you're probably"
echo " causing an infinite loop."
echo "Check that your condition is right, and that you're"
echo -e " adding 1 to your counter variable.${NC}"
if [[ $? == 124 ]]; then
echo -e "${BLUE}Your program took quite a while to run."
echo "So I've stopped it for you."
echo "You can try running it again if you like."
echo
echo "If you're on the 'while' material, you're probably"
echo " causing an infinite loop."
echo "Check that your condition is right, and that you're"
echo -e " adding 1 to your counter variable.${NC}"
fi
fi

0 comments on commit 273fa71

Please sign in to comment.