Skip to content

Instantly share code, notes, and snippets.

@andylolz
Created October 14, 2012 16:14
Show Gist options
  • Select an option

  • Save andylolz/3889054 to your computer and use it in GitHub Desktop.

Select an option

Save andylolz/3889054 to your computer and use it in GitHub Desktop.
Make key:generate work with the --env switch
diff --git a/laravel/cli/tasks/key.php b/laravel/cli/tasks/key.php
index 0c08a84..b7b5d00 100644
--- a/laravel/cli/tasks/key.php
+++ b/laravel/cli/tasks/key.php
@@ -19,7 +19,14 @@ class Key extends Task {
*/
public function __construct()
{
- $this->path = path('app').'config/application'.EXT;
+ if($environment = get_cli_option('env'))
+ {
+ $this->path = path('app').'config/'.$environment.'/application'.EXT;
+ }
+ else
+ {
+ $this->path = path('app').'config/application'.EXT;
+ }
}
/**
@andylolz
Copy link
Copy Markdown
Author

Never mind! (Someone already fixed this!)[http://github.com/laravel/laravel/issues/885]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment