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
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"])) {
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... :(");
227
-
}
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"])) {
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... :(");
232
-
}
233
-
if (isset(self::$options["styleguideKitPath"]) && !is_dir(self::$options["styleguideKitPath"])) {
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... :(");
235
-
}
236
-
221
+
// double-check a few directories are real and set-up
Console::writeError("please make sure ".$configOption." is set in <path>".Console::getHumanReadablePath($configPath)."</path> by adding '".$configOption."=some/path'. sorry, stopping pattern lab... :(");
34
+
} elseif (!is_dir($path)) {
35
+
Console::writeWarning("i can't seem to find the directory <path>".Console::getHumanReadablePath($path)."</path>...");
36
+
self::makeDir($path);
37
+
Console::writeWarning("i created <path>".Console::getHumanReadablePath($path)."</path> just in case. you can edit this in <path>".Console::getHumanReadablePath($configPath)."</path> by editing ".$configOption."...");
38
+
}
39
+
40
+
}
41
+
42
+
/**
43
+
* Make a directory
44
+
* @param {String} directory to be made
45
+
*/
46
+
publicstaticfunctionmakeDir($dir) {
47
+
$fs = newFilesystem();
48
+
try {
49
+
$fs->mkdir($dir);
50
+
} catch (IOExceptionInterface$e) {
51
+
Console::writeError("an error occurred while creating your directory at <path>".$e->getPath()."</path>...");
52
+
}
53
+
unset($fs);
54
+
}
55
+
24
56
/**
25
57
* Copies a file from the given source path to the given public path.
if (!$styleguideKitPath || !is_dir($styleguideKitPath)) {
50
+
Console::writeError("your styleguide won't render because i can't find your styleguide files. are you sure they're at <path>".Console::getHumanReadablePath($styleguideKitPath)."</path>? you can fix this in <path>./config/config.yml</path> by editing styleguideKitPath...");
0 commit comments