Skip to content

Commit

Permalink
Move automatic the public resources to public
Browse files Browse the repository at this point in the history
  • Loading branch information
webysther committed Jun 10, 2018
1 parent 77ebaae commit 7f75f34
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed country image vertical align
- Fixed delete file only if exists
- Open links on another tab
- When new mirror was created the public resources is copied to public

## [1.0.1]
- Synced date now is only using javascript
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
17 changes: 17 additions & 0 deletions src/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ protected function isEqual():bool
// if 'p/...' folder not found
if (!is_dir($this->filesystem->getFullPath(self::TO))) {
$this->filesystem->touch(self::INIT);
$this->moveToPublic();
}

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

/**
* Copy all public resources to public
*
* @return void
*/
protected function moveToPublic():void
{
$from = getcwd().'/resources/public/';
foreach (new \DirectoryIterator($from) as $fileInfo) {
if($fileInfo->isDot()) continue;
$file = $fileInfo->getFilename();
$to = $this->filesystem->getFullPath($file);
copy($from.$file, $to);
}
}

/**
* Download packages.json & provider-xxx$xxx.json.
*
Expand Down

0 comments on commit 7f75f34

Please sign in to comment.