File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function handle()
33
33
$ force = $ this ->option ('force ' );
34
34
35
35
foreach ($ this ->links () as $ link => $ target ) {
36
- if (file_exists ($ link ) && ! ( is_link ( $ link) && $ force )) {
36
+ if (file_exists ($ link ) && ! $ this -> removableSymlink ( $ link, $ force )) {
37
37
$ this ->error ("The [ $ link] link already exists. " );
38
38
continue ;
39
39
}
@@ -64,4 +64,16 @@ protected function links()
64
64
return $ this ->laravel ['config ' ]['filesystems.links ' ] ??
65
65
[public_path ('storage ' ) => storage_path ('app/public ' )];
66
66
}
67
+
68
+ /**
69
+ * Checks that the provided path is a symlink and force option is turned on.
70
+ *
71
+ * @param string $link
72
+ * @param bool $force
73
+ * @return bool
74
+ */
75
+ protected function removableSymlink (string $ link , bool $ force ): bool
76
+ {
77
+ return is_link ($ link ) && $ force ;
78
+ }
67
79
}
You can’t perform that action at this time.
0 commit comments