File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class StorageLinkCommand extends Command
11
11
*
12
12
* @var string
13
13
*/
14
- protected $ signature = 'storage:link {--relative : Create the symbolic link using relative paths} ' ;
14
+ protected $ signature = 'storage:link {--relative : Create the symbolic link using relative paths}
15
+ {--force : Recreate already existing symbolic links} ' ;
15
16
16
17
/**
17
18
* The console command description.
@@ -28,9 +29,10 @@ class StorageLinkCommand extends Command
28
29
public function handle ()
29
30
{
30
31
$ relative = $ this ->option ('relative ' );
32
+ $ force = $ this ->option ('force ' );
31
33
32
34
foreach ($ this ->links () as $ link => $ target ) {
33
- if (file_exists ($ link )) {
35
+ if (file_exists ($ link ) && ! ( is_link ( $ link ) && $ force ) ) {
34
36
$ this ->error ("The [ $ link] link already exists. " );
35
37
continue ;
36
38
}
You can’t perform that action at this time.
0 commit comments