From 7ad510d6ef66ba7471d8d4e7fee003752c0618f9 Mon Sep 17 00:00:00 2001 From: henrikbjorn Date: Thu, 7 Oct 2010 21:26:30 +0200 Subject: [PATCH] Added --symlink option to assets:install command --- .../FrameworkBundle/Command/AssetsInstallCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index 90af71a247..c51eea06d4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -34,6 +34,7 @@ class AssetsInstallCommand extends Command ->setDefinition(array( new InputArgument('target', InputArgument::REQUIRED, 'The target directory'), )) + ->addOption('symlink', null, InputOption::PARAMETER_NONE, 'Symlinks the assets instead of copying it') ->setName('assets:install') ; } @@ -58,8 +59,13 @@ class AssetsInstallCommand extends Command $targetDir = $input->getArgument('target').'/bundles/'.preg_replace('/bundle$/', '', strtolower($bundle->getName())); $filesystem->remove($targetDir); - mkdir($targetDir, 0777, true); - $filesystem->mirror($originDir, $targetDir); + + if ($input->getOption('symlink')) { + $filesystem->symlink($originDir, $targetDir); + } else { + mkdir($targetDir, 0777, true); + $filesystem->mirror($originDir, $targetDir); + } } } }