Description: The functions ask_if_create_venv in src/utils.rs uses unwrap() on io::stdout().flush() and io::stdin().read_line(). If the application is run in a non-interactive environment (like a CI/CD pipeline or a background cron job) where stdin is closed or redirected, these calls will panic, causing the application to crash unexpectedly.
Solution: Replace unwrap() with proper error handling. If read_line fails (indicating no stdin), assume a default answer (e.g., "no" or "yes" depending on safety) or return a specific error that can be handled gracefully. Alternatively, check if a TTY is attached using atty crate before attempting to read input.
Description: The functions ask_if_create_venv in src/utils.rs uses unwrap() on io::stdout().flush() and io::stdin().read_line(). If the application is run in a non-interactive environment (like a CI/CD pipeline or a background cron job) where stdin is closed or redirected, these calls will panic, causing the application to crash unexpectedly.
Solution: Replace unwrap() with proper error handling. If read_line fails (indicating no stdin), assume a default answer (e.g., "no" or "yes" depending on safety) or return a specific error that can be handled gracefully. Alternatively, check if a TTY is attached using atty crate before attempting to read input.