From 3422cdbf2850ce1730761b00a280752fbfaa0436 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Fri, 25 Dec 2020 19:53:16 -0800 Subject: [PATCH 1/2] Remove requirement for works_max --- README.md | 2 +- Styles/index.js | 2 +- Styles/tweak.mustache | 2 +- util/DebianPackager.py | 8 ++++++-- util/DepictionGenerator.py | 11 ++++++++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d00ecb8..a0fddfb 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ If you happen to have `git` installed on your computer and run `git clone https: ## Documentation ### `index.json` -Here is a comprehensive example of an `index.json` file. These reside in the package's `silica_data` folder and is required for the repo to properly compile. You **must** include the `bundle_id`, `name`, `version`, `tagline`, `section`, `works_min`, and `works_max`. All other values are optional, but are recommended (if applicable). +Here is a comprehensive example of an `index.json` file. These reside in the package's `silica_data` folder and is required for the repo to properly compile. You **must** include the `bundle_id`, `name`, `version`, `tagline`, `section`, and `works_min`. All other values are optional, but are recommended (if applicable). ```json { diff --git a/Styles/index.js b/Styles/index.js index 70baf1e..6de178c 100644 --- a/Styles/index.js +++ b/Styles/index.js @@ -6,7 +6,7 @@ function compatible(works_min, works_max, tweak_compatibility) { if (currentiOS < works_min) { el.innerHTML = "Your version of iOS is too old for this package. This package works on " + tweak_compatibility + "."; el.classList.add("red") - } else if(currentiOS > works_max) { + } else if(works_max != "." && currentiOS > works_max) { el.innerHTML = "Your version of iOS is too new for this package. This package works on " + tweak_compatibility + "."; el.classList.add("red") } else if(String(currentiOS) != "NaN") { diff --git a/Styles/tweak.mustache b/Styles/tweak.mustache index ca3e185..a725524 100644 --- a/Styles/tweak.mustache +++ b/Styles/tweak.mustache @@ -32,7 +32,7 @@
Compatibility: This package is compatible with iOS {{tweak_compatibility}}.
+Compatibility: This package is compatible with {{tweak_compatibility}}.
{{{tweak_carousel}}}{{{tweak_description}}}
diff --git a/util/DebianPackager.py b/util/DebianPackager.py index 3878d26..8c71f5e 100644 --- a/util/DebianPackager.py +++ b/util/DebianPackager.py @@ -144,11 +144,15 @@ def CompileControl(self, tweak_data, repo_settings): control_file += "Breaks: " + tweak_data['breaks'] + "\n" except Exception: pass + if 'works_max' in tweak_data: + compatible_max = ", compatible_max::ios" + tweak_data['works_max'] + else: + compatible_max = "" try: if tweak_data['tags']: - control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", compatible_max::ios" + tweak_data['works_max'] + ", " + tweak_data['tags'] + "\n" + control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", " + tweak_data['tags'] + "\n" except Exception: - control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", compatible_max::ios" + tweak_data['works_max'] + "\n" + control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + compatible_max + "\n" try: if tweak_data['developer']: diff --git a/util/DepictionGenerator.py b/util/DepictionGenerator.py index e8e7025..907f7db 100644 --- a/util/DepictionGenerator.py +++ b/util/DepictionGenerator.py @@ -104,13 +104,17 @@ def RenderPackageHTML(self, tweak_data): PackageLister.ErrorReporter(self, "Configuration Error!", "You are missing a package " "name in its index.json. Make sure this and other required properties are set.") try: + if 'works_max' in tweak_data: + works_max = " to " + tweak_data['works_max'] + replacements['works_max'] = tweak_data['works_max'] + else: + works_max = "" replacements['tweak_developer'] = tweak_data['developer']['name'] - replacements['tweak_compatibility'] = "iOS " + tweak_data['works_min'] + " to " + tweak_data['works_max'] + replacements['tweak_compatibility'] = "iOS " + tweak_data['works_min'] + works_max replacements['tweak_version'] = tweak_data['version'] replacements['tweak_section'] = tweak_data['section'] replacements['tweak_bundle_id'] = tweak_data['bundle_id'] replacements['works_min'] = tweak_data['works_min'] - replacements['works_max'] = tweak_data['works_max'] replacements['tweak_tagline'] = tweak_data['tagline'] except: PackageLister.ErrorReporter(self, "Configuration Error!", "You are missing an essential " @@ -190,6 +194,7 @@ def RenderPackageNative(self, tweak_data): changelog = DepictionGenerator.RenderNativeChangelog(self, tweak_data) screenshot_size = PackageLister.GetScreenshotSize(self, tweak_data) + works_max = " to " + tweak_data['works_max'] if 'works_max' in tweak_data else "" depiction = { "minVersion": "0.1", @@ -230,7 +235,7 @@ def RenderPackageNative(self, tweak_data): { "class": "DepictionTableTextView", "title": "Compatibility", - "text": "iOS " + tweak_data['works_min'] + " to " + tweak_data['works_max'] + "text": "iOS " + tweak_data['works_min'] + works_max }, { "class": "DepictionTableTextView", From 806a723c783c87259fb4bcb7d7dbb25bde50ede2 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Fri, 25 Dec 2020 19:53:34 -0800 Subject: [PATCH 2/2] Make setup.sh executable --- setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 setup.sh diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755