@@ -35,18 +35,25 @@ protected function configure()
35
35
new InputArgument ('target ' , InputArgument::REQUIRED , 'The target directory (usually "web") ' ),
36
36
))
37
37
->addOption ('symlink ' , null , InputOption::VALUE_NONE , 'Symlinks the assets instead of copying it ' )
38
+ ->addOption ('relative ' , null , InputOption::VALUE_NONE , 'Make relative symlinks ' )
38
39
->setDescription ('Install bundles web assets under a public web directory ' )
39
40
->setHelp (<<<EOT
40
41
The <info>assets:install</info> command installs bundle assets into a given
41
42
directory (e.g. the web directory).
42
43
43
- <info>php app/console assets:install web [--symlink] </info>
44
+ <info>php app/console assets:install web</info>
44
45
45
46
A "bundles" directory will be created inside the target directory, and the
46
47
"Resources/public" directory of each bundle will be copied into it.
47
48
48
49
To create a symlink to each bundle instead of copying its assets, use the
49
- <info>--symlink</info> option.
50
+ <info>--symlink</info> option:
51
+
52
+ <info>php app/console assets:install web --symlink</info>
53
+
54
+ To make symlink relative, add the <info>--relative</info> option:
55
+
56
+ <info>php app/console assets:install web --symlink --relative</info>
50
57
51
58
EOT
52
59
)
@@ -86,7 +93,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
86
93
$ filesystem ->remove ($ targetDir );
87
94
88
95
if ($ input ->getOption ('symlink ' )) {
89
- $ relativeOriginDir = $ filesystem ->makePathRelative ($ originDir , realpath ($ bundlesDir ));
96
+ if ($ input ->getOption ('relative ' )) {
97
+ $ relativeOriginDir = $ filesystem ->makePathRelative ($ originDir , realpath ($ bundlesDir ));
98
+ } else {
99
+ $ relativeOriginDir = $ originDir ;
100
+ }
90
101
$ filesystem ->symlink ($ relativeOriginDir , $ targetDir );
91
102
} else {
92
103
$ filesystem ->mkdir ($ targetDir , 0777 );
0 commit comments