HarshCasper / Rotten-Scripts

Scripts that will make you go WOW!
MIT License
1.47k stars 490 forks source link

Fix issue 1410: Automated Git commit script now uses subprocess.run instead of subprocess.getoutput #1433

Closed geekabhinav007 closed 1 year ago

geekabhinav007 commented 1 year ago

Description

  1. The new code uses the subprocess.run method instead of the deprecated subprocess.getoutput method. This makes the code more up-to-date and compatible with the latest version of Python.

  2. The new code uses the result.returncode attribute to check if a command was executed successfully, instead of relying on the output of the command. This is a more robust way to check if a command succeeded or failed.

  3. The new code prompts the user for input in a more user-friendly way, by providing default values that can be used if the user simply presses Enter.

  4. The new code includes error handling, by printing an error message and exiting the script if any of the Git commands fail.

  5. The new code includes more descriptive comments that explain what each line of code does, making it easier to understand and modify the script.

Fixes #1410

Type of change

Checklist:

testScreenShort

geekabhinav007 commented 1 year ago

@ClasherKasten please review the changes.

geekabhinav007 commented 1 year ago

Please Merge the Pull Request @ClasherKasten

github-actions[bot] commented 1 year ago

PR is not linked to any issue, please make the corresponding changes in the body. The issue should look like this. For help follow this link

github-actions[bot] commented 1 year ago

@geekabhinav007 Hurray, your PR got merged 🥳. Thanks a bunch. Feel free to take another Issue.💖