From e0db24aa9bb89e76aae549ac50da9a31aaa865c9 Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Sat, 21 Jan 2012 00:09:40 +0000 Subject: [PATCH] Create the bundle migrations dir automatically --- laravel/cli/tasks/migrate/migrator.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/laravel/cli/tasks/migrate/migrator.php b/laravel/cli/tasks/migrate/migrator.php index dbd16f41..15061887 100644 --- a/laravel/cli/tasks/migrate/migrator.php +++ b/laravel/cli/tasks/migrate/migrator.php @@ -194,9 +194,14 @@ public function make($arguments = array()) // next migration at the same time unknowingly. $date = date('Y_m_d').'_'.time(); - $path = Bundle::path($bundle).'migrations/'.$date.'_'.$migration.EXT; + $path = Bundle::path($bundle).'migrations'.DIRECTORY_SEPARATOR; - File::put($path, $this->stub($bundle, $migration)); + if ( ! is_dir($path)) + { + mkdir($path); + } + + File::put($path.$date.'_'.$migration.EXT, $this->stub($bundle, $migration)); echo "Great! New migration created!"; }