Example #1
0
            return "Cannot create a Model without a name";
        }
    });
}, file_get_contents(dirname(__FILE__) . "/console/descriptions/ng.html"));
Cli::command("build ng", function () {
    $output = shell_exec('gulp ng');
    return $output;
}, file_get_contents(dirname(__FILE__) . "/console/descriptions/ng.html"));
Cli::command("build mjml", function () {
    $output = shell_exec('gulp ng');
    return $output;
}, file_get_contents(dirname(__FILE__) . "/console/descriptions/ng.html"));
Cli::command("help", function ($args) {
    $cmds = "";
    $commandList = Registry::settings()->commands;
    sort($commandList);
    foreach ($commandList as $command) {
        if ($command["comments"] !== "") {
            $cmds .= "------------------------\n";
            $cmds .= "   |" . $command["origin"] . "\n------------------------\n" . $command["comments"] . "\n\n\n";
        } else {
            $cmds .= "------------------------\n";
            $cmds .= "   |" . $command["origin"] . "\n------------------------\n   NA\n\n\n";
        }
    }
    return strtr(file_get_contents("./system/console/help"), ["{{commands}}" => $cmds, "{{date}}" => date("Y")]);
});
Cli::uncaught(function () {
    return "Sorry! Could not find command. Here is a list of all the commands.\n\n\n" . Cli::run("help");
});
Cli::findArgv();