Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Fixed version checking and description handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Epp committed Jul 23, 2021
1 parent a8e0b65 commit 0c172ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Checks:

## Installation/Usage

1. Download `TSGen.Check.exe` from the [Releases](https://github.com/nayr31/TSGen.Check/releases) page.
1. Download `TSGen.Check.exe` from the [Releases](https://github.com/nayr31/TSGen.Check/releases) page.
2. Place it in a folder next to your `manifest.json` file you wish to check.
3. Run the program and follow the terminal prompts.
15 changes: 8 additions & 7 deletions TSGen.Check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json, re
from packaging.version import Version

input("\nPlease place your \"manifest.json\" inside of the this folder.\nPress enter to start check.")

Expand All @@ -23,19 +24,19 @@

print("\nVerifying \"version_number\"...")
try:
testList = json_data["version_number"].split(".")
if not len(testList) == 3:
print("\"version_number\" does not have the correct size, make sure that the format follows:")
print("\"x.x.x\", where each \'x\' is a number.")
else:
testString = json_data["version_number"]
try:
Version(json_data["version_number"])
print("Verified")
except:
print("Version number invalid, make sure it follows the \"x.x.x\" semantic versioning.")
except:
input("Failed to find \"version_number\" field, make sure it is present in your manifest.")

print("\nVerifying \"description\"...")
try:
testList = json_data["description"].split(".")
if not len(testList) <= 250:
testString = json_data["description"]
if not len(testString) <= 250:
print("\"description\" does not have the correct size, make sure that the format follows:")
print("Less than 250 characters.")
else:
Expand Down

0 comments on commit 0c172ad

Please sign in to comment.