@@ -107,7 +107,7 @@ protected static function getStyleguideKitPath($styleguideKitPath = "") {
107107 * @param {Boolean} whether we should print out the status of the config being loaded
108108 */
109109 public static function init ($ baseDir = "" , $ verbose = true ) {
110-
110+
111111 // make sure a base dir was supplied
112112 if (empty ($ baseDir )) {
113113 Console::writeError ("need a base directory to initialize the config class... " );
@@ -195,27 +195,87 @@ public static function init($baseDir = "", $verbose = true) {
195195 Console::writeError ("a set of configuration options is required to use Pattern Lab... " );
196196 exit ;
197197 }
198-
199- // set-up the various dirs
200- self ::$ options ["configDir " ] = self ::$ userConfigDir ;
201- self ::$ options ["configPath " ] = self ::$ userConfigPath ;
202- self ::$ options ["coreDir " ] = is_dir (self ::$ options ["baseDir " ]."_core " ) ? self ::$ options ["baseDir " ]."_core " : self ::$ options ["baseDir " ]."core " ;
203- self ::$ options ["exportDir " ] = isset (self ::$ options ["exportDir " ]) ? self ::$ options ["baseDir " ].self ::cleanDir (self ::$ options ["exportDir " ]) : self ::$ options ["baseDir " ]."exports " ;
204- self ::$ options ["publicDir " ] = isset (self ::$ options ["publicDir " ]) ? self ::$ options ["baseDir " ].self ::cleanDir (self ::$ options ["publicDir " ]) : self ::$ options ["baseDir " ]."public " ;
205- self ::$ options ["scriptsDir " ] = isset (self ::$ options ["scriptsDir " ]) ? self ::$ options ["baseDir " ].self ::cleanDir (self ::$ options ["scriptsDir " ]) : self ::$ options ["baseDir " ]."scripts " ;
206- self ::$ options ["sourceDir " ] = isset (self ::$ options ["sourceDir " ]) ? self ::$ options ["baseDir " ].self ::cleanDir (self ::$ options ["sourceDir " ]) : self ::$ options ["baseDir " ]."source " ;
207- self ::$ options ["componentDir " ] = isset (self ::$ options ["componentDir " ]) ? self ::$ options ["publicDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["componentDir " ]) : self ::$ options ["publicDir " ].DIRECTORY_SEPARATOR ."patternlab-components " ;
208- self ::$ options ["dataDir " ] = isset (self ::$ options ["dataDir " ]) ? self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["dataDir " ]) : self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR ."_data " ;
209- self ::$ options ["patternExportDir " ] = isset (self ::$ options ["patternExportDir " ]) ? self ::$ options ["exportDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["patternExportDir " ]) : self ::$ options ["exportDir " ].DIRECTORY_SEPARATOR ."patterns " ;
210- self ::$ options ["patternPublicDir " ] = isset (self ::$ options ["patternPublicDir " ]) ? self ::$ options ["publicDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["patternPublicDir " ]) : self ::$ options ["publicDir " ].DIRECTORY_SEPARATOR ."patterns " ;
211- self ::$ options ["patternSourceDir " ] = isset (self ::$ options ["patternSourceDir " ]) ? self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["patternSourceDir " ]) : self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR ."_patterns " ;
212- self ::$ options ["metaDir " ] = isset (self ::$ options ["metaDir " ]) ? self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["metaDir " ]) : self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR ."_meta/ " ;
213- self ::$ options ["annotationsDir " ] = isset (self ::$ options ["annotationsDir " ]) ? self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR .self ::cleanDir (self ::$ options ["annotationsDir " ]) : self ::$ options ["sourceDir " ].DIRECTORY_SEPARATOR ."_annotations/ " ;
198+
199+ // set-up the various dirs
200+ self ::$ options ["configDir " ] = self ::$ userConfigDir ;
201+
202+ self ::$ options ["configPath " ] = self ::$ userConfigPath ;
203+
204+ self ::$ options ["coreDir " ] =
205+ is_dir (self ::$ options ["baseDir " ] . "_core " )
206+ ? self ::$ options ["baseDir " ] . "_core "
207+ : self ::$ options ["baseDir " ] . "core " ;
208+
209+ self ::$ options ["exportDir " ] =
210+ isset (self ::$ options ["exportDir " ])
211+ ? self ::$ options ["baseDir " ] . self ::cleanDir (self ::$ options ["exportDir " ])
212+ : self ::$ options ["baseDir " ] . "exports " ;
213+
214+ self ::$ options ["publicDir " ] =
215+ isset (self ::$ options ["publicDir " ])
216+ ? self ::$ options ["baseDir " ] . self ::cleanDir (self ::$ options ["publicDir " ])
217+ : self ::$ options ["baseDir " ] . "public " ;
218+
219+ self ::$ options ["scriptsDir " ] =
220+ isset (self ::$ options ["scriptsDir " ])
221+ ? self ::$ options ["baseDir " ] . self ::cleanDir (self ::$ options ["scriptsDir " ])
222+ : self ::$ options ["baseDir " ] . "scripts " ;
223+
224+ self ::$ options ["sourceDir " ] =
225+ isset (self ::$ options ["sourceDir " ])
226+ ? self ::$ options ["baseDir " ] . self ::cleanDir (self ::$ options ["sourceDir " ])
227+ : self ::$ options ["baseDir " ] . "source " ;
228+
229+ self ::$ options ["componentDir " ] =
230+ isset (self ::$ options ["componentDir " ])
231+ ? self ::$ options ["publicDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["componentDir " ])
232+ : self ::$ options ["publicDir " ] . DIRECTORY_SEPARATOR . "patternlab-components " ;
233+
234+ self ::$ options ["dataDir " ] =
235+ isset (self ::$ options ["dataDir " ])
236+ ? self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["dataDir " ])
237+ : self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . "_data " ;
238+
239+ self ::$ options ["patternExportDir " ] =
240+ isset (self ::$ options ["patternExportDir " ])
241+ ? self ::$ options ["exportDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["patternExportDir " ])
242+ : self ::$ options ["exportDir " ] . DIRECTORY_SEPARATOR . "patterns " ;
243+
244+ self ::$ options ["patternPublicDir " ] =
245+ isset (self ::$ options ["patternPublicDir " ])
246+ ? self ::$ options ["publicDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["patternPublicDir " ])
247+ : self ::$ options ["publicDir " ] . DIRECTORY_SEPARATOR . "patterns " ;
248+
249+ self ::$ options ["patternSourceDir " ] =
250+ isset (self ::$ options ["patternSourceDir " ])
251+ ? self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["patternSourceDir " ])
252+ : self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . "_patterns " ;
253+
254+ self ::$ options ["metaDir " ] =
255+ isset (self ::$ options ["metaDir " ])
256+ ? self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["metaDir " ])
257+ : self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . "_meta/ " ;
258+
259+ self ::$ options ["annotationsDir " ] =
260+ isset (self ::$ options ["annotationsDir " ])
261+ ? self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . self ::cleanDir (self ::$ options ["annotationsDir " ])
262+ : self ::$ options ["sourceDir " ] . DIRECTORY_SEPARATOR . "_annotations/ " ;
214263
215264 // set-up outputFileSuffixes
216- self ::$ options ["outputFileSuffixes " ]["rendered " ] = isset (self ::$ options ["outputFileSuffixes " ]["rendered " ]) ? self ::$ options ["outputFileSuffixes " ]["rendered " ] : '' ;
217- self ::$ options ["outputFileSuffixes " ]["rawTemplate " ] = isset (self ::$ options ["outputFileSuffixes " ]["rawTemplate " ]) ? self ::$ options ["outputFileSuffixes " ]["rawTemplate " ] : '' ;
218- self ::$ options ["outputFileSuffixes " ]["markupOnly " ] = isset (self ::$ options ["outputFileSuffixes " ]["markupOnly " ]) ? self ::$ options ["outputFileSuffixes " ]["markupOnly " ] : '.markup-only ' ;
265+ self ::$ options ["outputFileSuffixes " ]["rendered " ] =
266+ isset (self ::$ options ["outputFileSuffixes " ]["rendered " ])
267+ ? self ::$ options ["outputFileSuffixes " ]["rendered " ]
268+ : '' ;
269+
270+ self ::$ options ["outputFileSuffixes " ]["rawTemplate " ] =
271+ isset (self ::$ options ["outputFileSuffixes " ]["rawTemplate " ])
272+ ? self ::$ options ["outputFileSuffixes " ]["rawTemplate " ]
273+ : '' ;
274+
275+ self ::$ options ["outputFileSuffixes " ]["markupOnly " ] =
276+ isset (self ::$ options ["outputFileSuffixes " ]["markupOnly " ])
277+ ? self ::$ options ["outputFileSuffixes " ]["markupOnly " ]
278+ : '.markup-only ' ;
219279
220280 // handle a pre-2.1.0 styleguideKitPath before saving it
221281 if (isset (self ::$ options ["styleguideKitPath " ])) {
0 commit comments