-
Notifications
You must be signed in to change notification settings - Fork 144
Simplify execution of main.py by removing command checks #1251
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
Changes from 1 commit
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -83,20 +83,6 @@ fi | |||||||||
|
|
||||||||||
| echo | ||||||||||
|
|
||||||||||
| # Run the main.py bootstrap script | ||||||||||
| # If only flags given (no command), show help without passing flags | ||||||||||
| has_command=false | ||||||||||
| for arg in "$@"; do | ||||||||||
| case "$arg" in -*) ;; *) has_command=true; break ;; esac | ||||||||||
| done | ||||||||||
| if [ "$has_command" = true ]; then | ||||||||||
| python3 "$(pwd)/toolchain/main.py" "$@" | ||||||||||
| else | ||||||||||
| python3 "$(pwd)/toolchain/main.py" | ||||||||||
| fi | ||||||||||
| code=$? | ||||||||||
|
|
||||||||||
| echo | ||||||||||
|
|
||||||||||
| if [ $code -ne 0 ]; then | ||||||||||
| error "main.py finished with a $code exit code." | ||||||||||
|
Comment on lines
101
to
102
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Safely handle the exit status by defaulting to zero when it is unset and avoid unquoted numeric comparison. [custom_rule] Severity Level: Minor
Suggested change
Why it matters? ⭐The existing numeric test can fail with "integer expression expected" when Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** mfc.sh
**Line:** 87:88
**Comment:**
*Custom Rule: Safely handle the exit status by defaulting to zero when it is unset and avoid unquoted numeric comparison.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
$codeis referenced but never set after the removal of thepython3execution block. This will cause the script to fail or behave unexpectedly. Either remove this conditional check or ensure$codeis set by adding back themain.pyexecution with proper exit code capture.