@@ -46,28 +46,28 @@ protected function configure()
46
46
$ this
47
47
->setName ('assets:install ' )
48
48
->setDefinition (array (
49
- new InputArgument ('target ' , InputArgument::OPTIONAL , 'The target directory ' , 'web ' ),
49
+ new InputArgument ('target ' , InputArgument::OPTIONAL , 'The target directory ' , 'public ' ),
50
50
))
51
51
->addOption ('symlink ' , null , InputOption::VALUE_NONE , 'Symlinks the assets instead of copying it ' )
52
52
->addOption ('relative ' , null , InputOption::VALUE_NONE , 'Make relative symlinks ' )
53
- ->setDescription ('Installs bundles web assets under a public web directory ' )
53
+ ->setDescription ('Installs bundles web assets under a public directory ' )
54
54
->setHelp (<<<'EOT'
55
55
The <info>%command.name%</info> command installs bundle assets into a given
56
- directory (e.g. the <comment>web </comment> directory).
56
+ directory (e.g. the <comment>public </comment> directory).
57
57
58
- <info>php %command.full_name% web </info>
58
+ <info>php %command.full_name% public </info>
59
59
60
60
A "bundles" directory will be created inside the target directory and the
61
61
"Resources/public" directory of each bundle will be copied into it.
62
62
63
63
To create a symlink to each bundle instead of copying its assets, use the
64
64
<info>--symlink</info> option (will fall back to hard copies when symbolic links aren't possible:
65
65
66
- <info>php %command.full_name% web --symlink</info>
66
+ <info>php %command.full_name% public --symlink</info>
67
67
68
68
To make symlink relative, add the <info>--relative</info> option:
69
69
70
- <info>php %command.full_name% web --symlink --relative</info>
70
+ <info>php %command.full_name% public --symlink --relative</info>
71
71
72
72
EOT
73
73
)
@@ -85,7 +85,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
85
85
$ targetArg = $ this ->getContainer ()->getParameter ('kernel.project_dir ' ).'/ ' .$ targetArg ;
86
86
87
87
if (!is_dir ($ targetArg )) {
88
- throw new \InvalidArgumentException (sprintf ('The target directory "%s" does not exist. ' , $ input ->getArgument ('target ' )));
88
+ // deprecated, logic to be removed in 4.0
89
+ // this allows the commands to work out of the box with web/ and public/
90
+ if (is_dir (dirname ($ targetArg ).'/web ' )) {
91
+ $ targetArg = dirname ($ targetArg ).'/web ' ;
92
+ } else {
93
+ throw new \InvalidArgumentException (sprintf ('The target directory "%s" does not exist. ' , $ input ->getArgument ('target ' )));
94
+ }
89
95
}
90
96
}
91
97
0 commit comments