From 5ef719fbb8931a48bf37b01c16ce231a37ae8013 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 16 May 2024 14:28:13 +1200 Subject: [PATCH] FIX Add brackets --- README.md | 2 +- funcs_scripts.php | 4 ++-- funcs_utils.php | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e635aa5..6481c2c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ MS_GITHUB_TOKEN=abc123 php run.php update --cms-major=5 --branch=next-minor --dr | --exclude=[modules] | Exclude the specified modules (without account prefix) separated by commas e.g. `silverstripe-mfa,silverstripe-totp` | | --dry-run | Do not push to github or create pull-requests | | --account | GitHub account to use for creating pull-requests (default: creative-commoners) | -| --no-delete | Do not delete `_data` and `modules` directories before running | +| --no-delete | Do not delete `_data` and `_modules` directories before running | | --update-prs | Update existing open PRs instead of creating new PRs | **Note** that using `--branch=github-default` will only run scripts in the `scripts/default-branch` directory. diff --git a/funcs_scripts.php b/funcs_scripts.php index e4618db..979d8fe 100644 --- a/funcs_scripts.php +++ b/funcs_scripts.php @@ -135,7 +135,7 @@ function module_is_recipe() error("Could not parse from composer.json - last error was $lastError"); } - return $json->type ?? '' === 'silverstripe-recipe'; + return ($json->type ?? '') === 'silverstripe-recipe'; } /** @@ -190,7 +190,7 @@ function is_composer_plugin() error("Could not parse from composer.json - last error was $lastError"); } - return $json->type ?? '' === 'composer-plugin'; + return ($json->type ?? '') === 'composer-plugin'; } /** diff --git a/funcs_utils.php b/funcs_utils.php index c7c26ad..5a92e13 100644 --- a/funcs_utils.php +++ b/funcs_utils.php @@ -50,6 +50,7 @@ function write_file($path, $contents) /** * Returns a list of all scripts files to run against a particular cms major version + * Scripts will be alphabetically sorted */ function script_files($cmsMajor) { @@ -78,6 +79,7 @@ function script_files($cmsMajor) } closedir($handle); } + sort($scriptFiles); return $scriptFiles; }