1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-10-31 23:38:08 +00:00

fixed test script

This commit is contained in:
Patrizio Bekerle 2017-05-16 19:03:37 +02:00
parent b443664675
commit a9066ec3f3
No known key found for this signature in database
GPG key ID: 2E9FFD770DABE838
2 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Example script",
"identifier": "example-scriptX",
"identifier": "example-script",
"script": "example-script.qml",
"version": "0.0.1",
"description" : "Use this script to start a new script you want to submit to the script repository.\\n\\nJust copy the whole 'example-script' folder and rename it and also the 'example-script.qml'"

View file

@ -1,4 +1,4 @@
#!/bin/env php
#!/usr/bin/env php
<?php
$dirs = array_filter(glob('*'), 'is_dir');
@ -21,8 +21,8 @@ if (count($errors) > 0) {
exit(1);
}
print "No errors were found";
print "No errors were found\n";
exit(0);
class TestHelper {
public $errors = array();
@ -42,7 +42,7 @@ class TestHelper {
$identifier = $data["identifier"];
if ($identifier == "") {
$errors[] = "No identifier was entered!";
} elseif (preg_match('/[^a-z0-9]/', $str)) {
} elseif (preg_match('/[^a-z0-9\-_]/', $identifier)) {
$errors[] = "Invalid charactes were found in identifier '$identifier'!";
}