Skip to content

Improve build script: Add error handling and DRY cleanup #688

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

Merged
merged 2 commits into from
Jul 26, 2025

Conversation

czgdp1807
Copy link
Member

🛠️ Summary

This PR improves the build script by:

  • 🧼 Replacing repetitive os.system(...) calls with a reusable run_cmd() function.
  • ❌ Adding proper error handling: the script now exits immediately if any build step fails.
  • ✅ Using argparse with action='store_true' for the --clean flag (instead of type=bool).
  • 🧪 Ensuring compatibility with CI/CD pipelines by failing fast on errors.

🔍 Why?

Previously, if any command in the build process failed, the script would still exit with code 0 — potentially causing CI to pass despite an error. This PR fixes that and makes the script cleaner and more maintainable.

📦 Affected script

  • scripts/build/install.py (or whichever file contains the build logic)

🧪 How to test

python scripts/build/install.py --clean

Try breaking a command manually — the script should exit with an error.

@czgdp1807 czgdp1807 changed the title Improve build script: Add error handling and DRY cleanu Improve build script: Add error handling and DRY cleanup Jul 26, 2025
@czgdp1807 czgdp1807 merged commit e05269a into codezonediitj:main Jul 26, 2025
7 checks passed
@czgdp1807 czgdp1807 deleted the fix_build branch July 26, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant