Skip to content

Commit

Permalink
Added --symlink option to assets:install command
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikbjorn authored and fabpot committed Oct 8, 2010
1 parent 18ba4fd commit 7ad510d
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -34,6 +34,7 @@ protected function configure()
->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')
;
}
Expand All @@ -58,8 +59,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$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);
}
}
}
}
Expand Down

0 comments on commit 7ad510d

Please sign in to comment.