Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack to find composer.json in a starterkit #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/PatternLab/Fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public function fetchStarterKit($starterkit = "") {
Console::writeError("the starterkit needs to contain a dist/ directory before it can be installed...");
}

if (!is_file($tempComposerFile)) {
// try without repo dir
$tempComposerFile = $tempDirSK.DIRECTORY_SEPARATOR."composer.json";
}

// check for composer.json. if it exists use it for determining things. otherwise just mirror dist/ to source/
if (file_exists($tempComposerFile)) {

Expand All @@ -103,7 +108,7 @@ public function fetchStarterKit($starterkit = "") {
// see if it has a patternlab section that might define the files to move
if (isset($tempComposerJSON["extra"]) && isset($tempComposerJSON["extra"]["patternlab"])) {
Console::writeInfo("installing the starterkit...");
InstallerUtil::parseComposerExtraList($tempComposerJSON["extra"]["patternlab"], $starterkit, $tempDirDist);
InstallerUtil::parseComposerExtraList($tempComposerJSON["extra"]["patternlab"], $starterkit, $tempDirDist.DIRECTORY_SEPARATOR);
Console::writeInfo("installed the starterkit...");
} else {
$this->mirrorDist($sourceDir, $tempDirDist);
Expand Down