diff --git a/funcs_scripts.php b/funcs_scripts.php index b2c360d..819a9af 100644 --- a/funcs_scripts.php +++ b/funcs_scripts.php @@ -144,6 +144,21 @@ function is_gha_repository() return strpos($MODULE_DIR, '/gha-') !== false; } +/** + * Return the module name without the account e.g. silverstripe/silverstripe-admin with return silverstripe-admin + * + * Example usage: + * if (module_name() === 'silverstripe-admin) { + * // logic + * } + */ +function module_name() +{ + global $MODULE_DIR; + $parts = explode('/', $MODULE_DIR); + return end($parts); +} + /** * Determine if the module being processed is one of the modules in a list * diff --git a/scripts/cms-any/action-ci.php b/scripts/cms-any/action-ci.php index 9a41eb7..50932da 100644 --- a/scripts/cms-any/action-ci.php +++ b/scripts/cms-any/action-ci.php @@ -1,7 +1,7 @@