Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 7f75f34

Browse files
committed
Move automatic the public resources to public
1 parent 77ebaae commit 7f75f34

File tree

7 files changed

+18
-0
lines changed

7 files changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
- Fixed country image vertical align
1010
- Fixed delete file only if exists
1111
- Open links on another tab
12+
- When new mirror was created the public resources is copied to public
1213

1314
## [1.0.1]
1415
- Synced date now is only using javascript
File renamed without changes.
File renamed without changes.

src/Command/Create.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ protected function isEqual():bool
135135
// if 'p/...' folder not found
136136
if (!is_dir($this->filesystem->getFullPath(self::TO))) {
137137
$this->filesystem->touch(self::INIT);
138+
$this->moveToPublic();
138139
}
139140

140141
$this->initialized = $this->filesystem->hasFile(self::INIT);
@@ -164,6 +165,22 @@ protected function isEqual():bool
164165
return false;
165166
}
166167

168+
/**
169+
* Copy all public resources to public
170+
*
171+
* @return void
172+
*/
173+
protected function moveToPublic():void
174+
{
175+
$from = getcwd().'/resources/public/';
176+
foreach (new \DirectoryIterator($from) as $fileInfo) {
177+
if($fileInfo->isDot()) continue;
178+
$file = $fileInfo->getFilename();
179+
$to = $this->filesystem->getFullPath($file);
180+
copy($from.$file, $to);
181+
}
182+
}
183+
167184
/**
168185
* Download packages.json & provider-xxx$xxx.json.
169186
*

0 commit comments

Comments
 (0)