@@ -13,6 +13,23 @@ for h_lib in $(ls ./src/*lib.h); do
1313done
1414}
1515
16+ add_score () {
17+ SCORE_MESSAGE=$1
18+ echo " ${this_new_name} ,${model_name} ,${diff} ,${loopster_count} ,${SCORE_MESSAGE} " >> score.csv
19+ }
20+
21+ # Function to be called when Ctrl+C is pressed
22+ ctrl_c () {
23+ echo -e " \n** Ouch! SIGINT received (Ctrl+C). Performing cleanup..." >&2
24+ # Add your cleanup logic here (e.g., remove temporary files, stop services)
25+ add_score " interrupt-fail"
26+ # echo "${this_new_name},${model_name},${diff},${loopster_count},interrupt-fail" >> score.csv
27+ echo " ** Cleanup complete. Exiting script." >&2
28+ exit 1 # Exit the script after handling the signal
29+ }
30+ # Set the trap: call the ctrl_c function when SIGINT (INT) is received
31+ trap ctrl_c INT
32+
1633clean_dirty_git () {
1734 if [[ $( git status --porcelain) ]]; then
1835 echo " Git working directory is dirty. committing everything..."
@@ -69,7 +86,8 @@ do_aider () {
6986 set +e
7087 bats test/full.bats
7188 if [[ ! $? -eq 0 ]]; then
72- echo " ${this_new_name} ,${model_name} ,${diff} ,fail" > score.csv
89+ add_score " initial-fail"
90+ # echo "${this_new_name},${model_name},${diff},${loopster_count},initial-fail" >> score.csv
7391 loopster -c 5 \
7492 --success-cleanup ./successLoopster.sh \
7593 --fail-cleanup ./failLoopster.sh \
@@ -78,7 +96,8 @@ do_aider () {
7896 else
7997 clean_dirty_git
8098 git checkout -b " ${this_new_name} _success"
81- echo " ${this_new_name} ,${model_name} ,${diff} ,${loopster_count} ,eagle" >> score.csv
99+ add_score " eagle"
100+ # echo "${this_new_name},${model_name},${diff},${loopster_count},eagle" >> score.csv
82101 fi
83102 # set -e
84103 echo $reads | grep " src/$this_lib_file " > /dev/null
0 commit comments