File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ LOG_FILE=" logs.txt"
3+
4+ # Clear existing log file
5+ > " $LOG_FILE "
6+
7+ run_command () {
8+ local name=" $1 "
9+ local cmd=" $2 "
10+ echo " === Running: $name ===" >> " $LOG_FILE "
11+ echo " Command: $cmd " >> " $LOG_FILE "
12+ echo " Timestamp: $( date) " >> " $LOG_FILE "
13+ echo " ----------------------------------------" >> " $LOG_FILE "
14+ eval " $cmd " >> " $LOG_FILE " 2>&1
15+ local exit_code=$?
16+ echo " Exit code: $exit_code " >> " $LOG_FILE "
17+ echo " ========================================" >> " $LOG_FILE "
18+ echo " " >> " $LOG_FILE "
19+ return $exit_code
20+ }
21+
22+ run_command " bun test" " bun test"
23+ run_command " bun run test" " bun run test"
24+ run_command " bun lint" " bun lint"
25+ run_command " bun run lint" " bun run lint"
26+ run_command " bun typecheck" " bun typecheck"
27+ run_command " bun run typecheck" " bun run typecheck"
28+
29+ echo " All commands executed. Output saved to $LOG_FILE "
You can’t perform that action at this time.
0 commit comments