mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-21 23:48:08 +00:00
added new variable "platforms"
This commit is contained in:
parent
98a2ba591d
commit
ec4381bf05
2 changed files with 24 additions and 11 deletions
|
@ -3,7 +3,8 @@
|
|||
"identifier": "example-script",
|
||||
"script": "example-script.qml",
|
||||
"authors": ["@pbek"],
|
||||
"version": "0.0.1",
|
||||
"minAppVersion": "17.05.6",
|
||||
"platforms": ["linux", "macos", "windows"],
|
||||
"version": "0.0.2",
|
||||
"minAppVersion": "17.06.2",
|
||||
"description" : "Use this script to start a new script you want to submit to the script repository.\n\nJust copy the whole <i>example-script</i> folder from the git-repository on GitHub and rename both the folder and <i>example-script.qml</i>."
|
||||
}
|
||||
|
|
|
@ -61,6 +61,18 @@ class TestHelper {
|
|||
$errors[] = "No version was entered!";
|
||||
}
|
||||
|
||||
if (isset($data["platforms"])) {
|
||||
if (!is_array($data["platforms"])) {
|
||||
$errors[] = "'platforms' has to be an array!";
|
||||
} else {
|
||||
foreach ($data["platforms"] as $platform) {
|
||||
if (!in_array($platform, array("linux", "macos", "windows"))) {
|
||||
$errors[] = "Unsupported platform '$platform', only 'linux', 'macos' and 'windows' are allowed!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($errors) > 0) {
|
||||
$this->errors[$dir] = $errors;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue