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

Commit 5a9c13a

Browse files
committed
making sure the config runs after migrations
1 parent 3f8bc7f commit 5a9c13a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

core/lib/PatternLab/Configurer.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,16 @@ public function getConfig() {
6262
$config = parse_ini_file($this->userConfigPath);
6363
}
6464

65-
// check the config version and update it if necessary
66-
if ($migrate || ($config["v"] != $defaultConfig["v"])) {
67-
print "upgrading your version of pattern lab...\n";
68-
$config = $this->writeNewConfig($config,$defaultConfig);
69-
$diffVersion = true;
70-
}
65+
// compare version numbers
66+
$diffVersion = ($config["v"] != $defaultConfig["v"]) ? true : false;
7167

72-
// if either migrate or diff version run the migrations
68+
// run an upgrade and migrations if necessary
7369
if ($migrate || $diffVersion) {
70+
print "upgrading your version of pattern lab...\n";
7471
print "checking for migrations...\n";
7572
$m = new Migrator;
7673
$m->migrate($diffVersion);
74+
$config = $this->writeNewConfig($config,$defaultConfig);
7775
}
7876

7977
return $config;

0 commit comments

Comments
 (0)