1
0
mirror of https://github.com/pattern-lab/patternlab-php.git synced 2025-01-17 22:29:12 +01:00

adding fetch command support

This commit is contained in:
Dave Olsen 2014-05-09 16:20:14 -04:00
parent e523370ad3
commit 0fa8da0bb8

View File

@ -47,8 +47,7 @@ $console->setCommand("s","snapshot","Watch for changes and regenerate","The watc
$console->setCommandOption("s","d:","dir:","Optional directory path","To add an optional directory path instead of the defaul v*/ path:");
// set-up the fetch command and options
$console->setCommand("s","snapshot","Watch for changes and regenerate","The watch command builds Pattern Lab, watches for changes in source/ and regenerates Pattern Lab when there are any.");
$console->setCommandOption("s","d:","dir:","Optional directory path","To add an optional directory path instead of the defaul v*/ path:");
$console->setCommand("f:","fetch:","Watch for changes and regenerate","The watch command builds Pattern Lab, watches for changes in source/ and regenerates Pattern Lab when there are any.");
// set-up the version command
$console->setCommand("v","version","Print the version number","The version command prints out the current version of Pattern Lab.");
@ -56,7 +55,6 @@ $console->setCommand("v","version","Print the version number","The version comma
// set-up the help command
$console->setCommand("h","help","Print the help for a given command","The help command prints out the help for a given flag. Just use -h with another command and it will tell you all of the options.");
/*******************************
* Figure out what to run
*******************************/
@ -110,6 +108,13 @@ if ($console->findCommand("h|help") && ($command = $console->getCommand())) {
$s = new PatternLab\Snapshot($config);
$s->takeSnapshot($snapshotDir);
} else if ($command == "f") {
// run the snapshot command
$starterKit = $console->findCommandValue("f|fetch");
$sk = new PatternLab\StarterKit($config);
$sk->fetch($starterKit);
} else if ($command == "v") {
// write out the version number