You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PatternLab/Config.php
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -219,13 +219,18 @@ public static function init($baseDir = "", $verbose = true) {
219
219
}
220
220
221
221
// double-check a few directories are real
222
-
if (!is_dir(self::$options["sourceDir"])) {
222
+
// refactor this at some point. it's verbose
223
+
if (!isset(self::$options["sourceDir"])) {
224
+
Console::writeError("please make sure sourceDir is set in <path>./config/config.yml</path> by adding 'sourceDir=some/path'. sorry, stopping pattern lab... :(");
225
+
} elseif (!is_dir(self::$options["sourceDir"])) {
223
226
Console::writeError("hrm... i can't seem to find the directory with your source files. are you sure they're at <path>".Console::getHumanReadablePath(self::$options["sourceDir"])."</path>? you can fix this in <path>./config/config.yml</path> by editing sourceDir. sorry, stopping pattern lab... :(");
224
227
}
225
-
if (!is_dir(self::$options["publicDir"])) {
228
+
if (!isset(self::$options["publicDir"])) {
229
+
Console::writeError("please make sure publicDir is set in <path>./config/config.yml</path> by adding 'publicDir=some/path'. sorry, stopping pattern lab... :(");
230
+
} elseif (!is_dir(self::$options["publicDir"])) {
226
231
Console::writeError("hrm... i can't seem to find the directory where you want to write your styleguide. are you sure it's at <path>".Console::getHumanReadablePath(self::$options["sourceDir"])."</path>? you can fix this in <path>./config/config.yml</path> by editing publicDir. sorry, stopping pattern lab... :(");
227
232
}
228
-
if (!is_dir(self::$options["styleguideKitPath"])) {
233
+
if (isset(self::$options["styleguideKitPath"]) && !is_dir(self::$options["styleguideKitPath"])) {
229
234
Console::writeError("hrm... i can't seem to find the directory where your styleguide files are located. are you sure it's at <path>".Console::getHumanReadablePath(self::$options["styleguideKitPath"])."</path>? you can fix this in <path>./config/config.yml</path> by editing styleguideKitPath. sorry, stopping pattern lab... :(");
0 commit comments