-
Notifications
You must be signed in to change notification settings - Fork 303
fix(regen-defs): Fix globs and clean tempfiles on INT, TERM #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,8 +23,14 @@ for folder in $folders; do | |
| stdout_file=$(mktemp) | ||
| stderr_file=$(mktemp) | ||
|
|
||
| # Cleanup on interruption | ||
| cleanup() { | ||
| rm "$stdout_file" "$stderr_file" | ||
| } | ||
| trap cleanup INT TERM | ||
aaronliu0130 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Execute the command and capture stdout and stderr | ||
| uv run "$cpplint" $cmd > "$stdout_file" 2> "$stderr_file" | ||
| eval uv run "$cpplint" $cmd > "$stdout_file" 2> "$stderr_file" | ||
| ret_code=$? | ||
|
|
||
| # Count the number of lines in stdout | ||
|
|
@@ -42,7 +48,7 @@ for folder in $folders; do | |
| } > "$file" | ||
|
|
||
| # Clean up temporary files | ||
| rm "$stdout_file" "$stderr_file" | ||
| cleanup | ||
|
||
| done | ||
| cd .. | ||
| done | ||
Uh oh!
There was an error while loading. Please reload this page.