Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit f27f3bf

Browse files
committed
untested tweaks for the migrator
1 parent d0370a5 commit f27f3bf

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

core/lib/PatternLab/Migrator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ public function migrate($diffVersion = false) {
3535

3636
if (!$migration->isDot() && $migration->isFile() && ($filename[0] != "_")) {
3737

38+
$basePath = __DIR__."/../../../";
3839
$migrationData = json_decode(file_get_contents($migration->getPathname()));
39-
$sourcePath = __DIR__."/../../../".$migrationData->sourcePath;
40-
$destinationPath = __DIR__."/../../../".$migrationData->destinationPath;
40+
$sourcePath = ($checkType == "fileExists") ? $basePath.$migrationData->sourcePath : $basePath.$migrationData->sourcePath.DIRECTORY_SEPARATOR;
41+
$destinationPath = ($checkType == "fileExists") ? $basePath.$migrationData->destinationPath : $basePath.$migrationData->destinationPath.DIRECTORY_SEPARATOR;
4142
$checkType = $migrationData->checkType;
4243

4344
if ($checkType == "dirEmpty") {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sourcePath": "core/styleguide/",
3-
"destinationPath": "public/styleguide/",
2+
"sourcePath": "core/styleguide",
3+
"destinationPath": "public/styleguide",
44
"checkType": "versionDiffDir"
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sourcePath": "core/source/_patterns/00-atoms/00-meta/",
3-
"destinationPath": "source/_patterns/00-atoms/00-meta/",
2+
"sourcePath": "core/source/_patterns/00-atoms/00-meta",
3+
"destinationPath": "source/_patterns/00-atoms/00-meta",
44
"checkType": "dirExists"
55
}

0 commit comments

Comments
 (0)