Skip to content

Commit

Permalink
Added assets.json file check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardog committed Nov 14, 2017
1 parent 0f412f6 commit 2293593
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions class/Factory/BaseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ private function getScript($scriptName)
private function getAssetPath($scriptName)
{
$rootDirectory = $this->getStoriesRootDirectory();
if (!is_file($rootDirectory . 'assets.json')) {
exit('Missing assets.json file. Run npm run prod in stories directory.');
}
$jsonRaw = file_get_contents($rootDirectory . 'assets.json');
$json = json_decode($jsonRaw, true);
if (!isset($json[$scriptName]['js'])) {
Expand Down

0 comments on commit 2293593

Please sign in to comment.