Skip to content

Commit 795710d

Browse files
committed
Force symlink recreation
1 parent 3062083 commit 795710d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Illuminate/Foundation/Console/StorageLinkCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ class StorageLinkCommand extends Command
1111
*
1212
* @var string
1313
*/
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}';
1516

1617
/**
1718
* The console command description.
@@ -28,9 +29,10 @@ class StorageLinkCommand extends Command
2829
public function handle()
2930
{
3031
$relative = $this->option('relative');
32+
$force = $this->option('force');
3133

3234
foreach ($this->links() as $link => $target) {
33-
if (file_exists($link)) {
35+
if (file_exists($link) && ! (is_link($link) && $force)) {
3436
$this->error("The [$link] link already exists.");
3537
continue;
3638
}

0 commit comments

Comments
 (0)