summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2011-03-31 14:26:34 (GMT)
committer JohnAlbin2011-03-31 20:09:25 (GMT)
commit227b420c45e0fed8ae90f23070f8c8fd850743d2 (patch)
tree00936331b20edfd18253fc8357784d00953851fa
parentecb4cde2969f3bd207cfaa382b5b92109cce2fe5 (diff)
by JohnAlbin: Ensure the specified machine name is valid.
-rw-r--r--zen-internals/zen.drush.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/zen-internals/zen.drush.inc b/zen-internals/zen.drush.inc
index 1611b95..94d45ab 100644
--- a/zen-internals/zen.drush.inc
+++ b/zen-internals/zen.drush.inc
@@ -35,15 +35,17 @@ function zen_drush_command() {
*/
function drush_zen($name = 'My theme') {
+ // Determine the machine name.
$machine_name = drush_get_option('machine-name');
if (!$machine_name) {
- $machine_name = str_replace(' ', '_', strtolower($name));
- $search = array(
- '/[^a-z0-9_]/', // Remove characters not valid in function names.
- '/^[^a-z]+/', // Functions must begin with an alpha character.
- );
- $machine_name = preg_replace($search, '', $machine_name);
+ $machine_name = $name;
}
+ $machine_name = str_replace(' ', '_', strtolower($machine_name));
+ $search = array(
+ '/[^a-z0-9_]/', // Remove characters not valid in function names.
+ '/^[^a-z]+/', // Functions must begin with an alpha character.
+ );
+ $machine_name = preg_replace($search, '', $machine_name);
$zen_path = drush_locate_root() . '/' . drupal_get_path('theme', 'zen');