Update script to improve payload creation and response handling (create_repo.sh)
anupammaurya6767 opened this issue · 2 comments
Description:
I propose the following updates to the existing script to enhance the payload creation and improve the handling of API responses when creating a GitHub repository.
Changes:
-
Instead of directly creating the payload using cat, we're now using jq to construct a JSON object with the necessary fields. This ensures the proper handling of special characters and prevents potential issues.
-
Removed the private and auto_init fields from the payload creation since you set them to false by default.
-
Utilized jq to parse the response from GitHub and extract the relevant information for error handling and success messages.
Benefits:
- The updated payload creation using jq ensures proper handling of special characters and prevents issues that may arise when using cat directly.
- The use of jq to parse the response allows for more accurate error handling and success messages, providing better feedback during the repository creation process.
@sahil-sagwekar2652 I am a GSSOC contributor
I want to work on this issue
Please assign it to me
The create_repo.sh script should also initialize the local repository along with the remote one. Currently, it only does the latter part. Please see if you can implement this feature so that it works similarly to how create_repo.py works.