Skip to content
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

feat: Check Template Validity before downloading #256

Merged

Conversation

viralgupta
Copy link
Contributor

right now we dont have a check before downloading the zip to determine if a template is a valid template or not, and the app exits with error not telling the actual issue, I have added a check before downloading the template if neutralino.config.json file exists in root directory of the template repository or not to determine if the template is valid or not.

Previous Error
image

Current Error
image

Comment on lines 209 to 210
'X-GitHub-Api-Version': '2022-11-28',
"Accept": "application/vnd.github+json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to set these two HTTP headers? Thanks 🎉

Copy link
Contributor Author

@viralgupta viralgupta Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Accept': 'application/vnd.github+json' header specifies that we want the response in JSON format. However, since JSON is the default format, we can ignore this header.

The 'X-GitHub-Api-Version': '2022-11-28' header specifies the API version we want to use. If we don't specify this, it will default to the initial release API version, which is also '2022-11-28', so we can remove that header as well.

ps: added commits to this pr applying the changes 🎉

Copy link
Member

@shalithasuranga shalithasuranga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this @viralgupta. Looks great. I added only one inline commend. We can merge this when it's resolved 🎉

@shalithasuranga shalithasuranga merged commit 5d603d1 into neutralinojs:main Apr 11, 2024
2 checks passed
@shalithasuranga
Copy link
Member

Note: Some updates done via 29c7c18

@viralgupta
Copy link
Contributor Author

Thank you sir, for refactoring my code. I'll aim to write better code in the future.

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.

2 participants