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

Commit

Permalink
Merge branch 'release-0.7.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolsen committed Mar 21, 2014
2 parents 6b878e3 + fd9ed08 commit 56955fc
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 61 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.

PL-v0.7.11
- FIX: migrator now orders migrations properly for ubuntu
- THX: thanks to @krulik for reporting the issue & @paulovieira for confirming the fix

PL-v0.7.10
- ADD: more responsive pull bar
- THX: thanks to @crohrer for the pull request making the pull bar more responsive
Expand Down
2 changes: 1 addition & 1 deletion core/builder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Builder CLI - v0.7.10
* Pattern Lab Builder CLI - v0.7.11
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion core/config/config.ini.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* If config.ini doesn't exist Pattern Lab will try to create a new version
*/

v = "0.7.10"
v = "0.7.11"

// file extensions to ignore when building or watching the source dir, separate with a comma
ie = "scss,DS_Store,less"
Expand Down
2 changes: 1 addition & 1 deletion core/lib/PatternLab/Builder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Builder Class - v0.7.10
* Pattern Lab Builder Class - v0.7.11
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion core/lib/PatternLab/Configurer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Configurer Class - v0.7.10
* Pattern Lab Configurer Class - v0.7.11
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion core/lib/PatternLab/Console.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Console Class - v0.7.10
* Pattern Lab Console Class - v0.7.11
*
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion core/lib/PatternLab/Generator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Generator Class - v0.7.10
* Pattern Lab Generator Class - v0.7.11
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down
109 changes: 55 additions & 54 deletions core/lib/PatternLab/Migrator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Migrator Class - v0.7.10
* Pattern Lab Migrator Class - v0.7.11
*
* Copyright (c) 2014 Dave Olsen http://dmolsen.com
* Licensed under the MIT license
Expand All @@ -27,66 +27,70 @@ public function __construct() {
*/
public function migrate($diffVersion = false) {

$migrations = new \DirectoryIterator(__DIR__."/../../migrations/");
$migrations = new \DirectoryIterator(__DIR__."/../../migrations/");
$migrationsValid = array();

foreach ($migrations as $migration) {

$filename = $migration->getFilename();

if (!$migration->isDot() && $migration->isFile() && ($filename[0] != "_")) {
$migrationsValid[] = $filename;
}
}

asort($migrationsValid);

foreach ($migrationsValid as $filename) {

$basePath = __DIR__."/../../../";
$migrationData = json_decode(file_get_contents(__DIR__."/../../migrations/".$filename));
$checkType = $migrationData->checkType;
$sourcePath = ($checkType == "fileExists") ? $basePath.$migrationData->sourcePath : $basePath.$migrationData->sourcePath.DIRECTORY_SEPARATOR;
$destinationPath = ($checkType == "fileExists") ? $basePath.$migrationData->destinationPath : $basePath.$migrationData->destinationPath.DIRECTORY_SEPARATOR;

if ($checkType == "dirEmpty") {

$basePath = __DIR__."/../../../";
$migrationData = json_decode(file_get_contents($migration->getPathname()));
$checkType = $migrationData->checkType;
$sourcePath = ($checkType == "fileExists") ? $basePath.$migrationData->sourcePath : $basePath.$migrationData->sourcePath.DIRECTORY_SEPARATOR;
$destinationPath = ($checkType == "fileExists") ? $basePath.$migrationData->destinationPath : $basePath.$migrationData->destinationPath.DIRECTORY_SEPARATOR;

if ($checkType == "dirEmpty") {

$emptyDir = true;
$objects = new \DirectoryIterator($destinationPath);
foreach ($objects as $object) {
if (!$object->isDot() && ($object->getFilename() != "README") && ($object->getFilename() != ".DS_Store")) {
$emptyDir = false;
}
$emptyDir = true;
$objects = new \DirectoryIterator($destinationPath);
foreach ($objects as $object) {
if (!$object->isDot() && ($object->getFilename() != "README") && ($object->getFilename() != ".DS_Store")) {
$emptyDir = false;
}

if ($emptyDir) {
$this->runMigration($filename, $sourcePath, $destinationPath, false);
}

} else if ($checkType == "dirExists") {

if (!is_dir($destinationPath)) {
mkdir($destinationPath);
}

} else if ($checkType == "fileExists") {

if (!file_exists($destinationPath)) {
$this->runMigration($filename, $sourcePath, $destinationPath, true);
}

} else if (($checkType == "versionDiffDir") && $diffVersion) {

// make sure the destination path exists
if (!is_dir($destinationPath)) {
mkdir($destinationPath);
}

}

if ($emptyDir) {
$this->runMigration($filename, $sourcePath, $destinationPath, false);

} else if (($checkType == "versionDiffFile") && $diffVersion) {

}

} else if ($checkType == "dirExists") {

if (!is_dir($destinationPath)) {
mkdir($destinationPath);
}

} else if ($checkType == "fileExists") {

if (!file_exists($destinationPath)) {
$this->runMigration($filename, $sourcePath, $destinationPath, true);

} else {

print "Pattern Lab doesn't recognize a checkType of ".$checkType.". The migrator class is pretty thin at the moment.\n";
exit;

}

} else if (($checkType == "versionDiffDir") && $diffVersion) {

// make sure the destination path exists
if (!is_dir($destinationPath)) {
mkdir($destinationPath);
}

$this->runMigration($filename, $sourcePath, $destinationPath, false);

} else if (($checkType == "versionDiffFile") && $diffVersion) {

$this->runMigration($filename, $sourcePath, $destinationPath, true);

} else {

print "Pattern Lab doesn't recognize a checkType of ".$checkType.". The migrator class is pretty thin at the moment.\n";
exit;

}

}
Expand All @@ -111,10 +115,7 @@ protected function runMigration($filename, $sourcePath, $destinationPath, $singl

} else {

// iterate over all of the other files in the source directory and move them if their modified time has changed
$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourcePath), \RecursiveIteratorIterator::SELF_FIRST);

// make sure dots are skipped
$objects->setFlags(\FilesystemIterator::SKIP_DOTS);

foreach ($objects as $object) {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/PatternLab/Watcher.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*!
* Pattern Lab Watcher Class - v0.7.10
* Pattern Lab Watcher Class - v0.7.11
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
Expand Down

0 comments on commit 56955fc

Please sign in to comment.