|
23 | 23 | use \PatternLab\Data;
|
24 | 24 | use \PatternLab\Dispatcher;
|
25 | 25 | use \PatternLab\FileUtil;
|
| 26 | +use \PatternLab\InstallerUtil; |
26 | 27 | use \PatternLab\PatternData;
|
27 | 28 | use \PatternLab\Util;
|
28 | 29 | use \PatternLab\Timer;
|
@@ -324,22 +325,28 @@ private function updateSite($fileName,$message,$verbose = true) {
|
324 | 325 |
|
325 | 326 | }
|
326 | 327 |
|
327 |
| - public function watchStarterKit() { |
328 |
| - |
329 |
| - // double-checks options was properly set |
330 |
| - /*$starterKit = Config::getOption("starterKit"); |
331 |
| - if (!$starterKit) { |
332 |
| - Console::writeError("need to have a starterkit set in the config..."); |
333 |
| - }*/ |
| 328 | + protected function starterKitPathPrompt() { |
| 329 | + |
| 330 | + // need to figure this out long-term |
| 331 | + InstallerUtil::$isInteractive = true; |
| 332 | + $input = Console::promptInput("Tell me the path to the starterkit you want to watch.","e.g. vendor/pattern-lab/starterkit-mustache-demo/dist","baz",false); |
334 | 333 |
|
335 | 334 | // set-up the full starterkit path
|
336 |
| - $starterKitPath = Config::getOption("baseDir")."vendor/pattern-lab/starterkit-mustache-demo/dist"; |
| 335 | + $starterKitPath = Config::getOption("baseDir").$input; |
337 | 336 | if (!is_dir($starterKitPath)) {
|
338 |
| - Console::writeError("the starterkit doesn't seem to exist..."); |
| 337 | + Console::writeWarning("that doesn't seem to be a real directory. let's try again..."); |
| 338 | + $starterKitPath = $this->starterKitPathPrompt(); |
339 | 339 | }
|
340 | 340 |
|
| 341 | + return $starterKitPath; |
| 342 | + |
| 343 | + } |
| 344 | + |
| 345 | + public function watchStarterKit() { |
| 346 | + |
341 | 347 | // default vars
|
342 |
| - $sourceDir = Config::getOption("sourceDir"); |
| 348 | + $starterKitPath = $this->starterKitPathPrompt(); |
| 349 | + $sourceDir = Config::getOption("sourceDir"); |
343 | 350 |
|
344 | 351 | $fs = new Filesystem();
|
345 | 352 |
|
|
0 commit comments