Updated CLI tasks

This commit is contained in:
Eldad Fux 2020-09-15 22:50:21 +03:00
parent ccf5300906
commit ea9898abab
4 changed files with 8 additions and 14 deletions

View file

@ -146,6 +146,7 @@ RUN chmod +x /usr/local/bin/doctor && \
chmod +x /usr/local/bin/install && \
chmod +x /usr/local/bin/migrate && \
chmod +x /usr/local/bin/schedule && \
chmod +x /usr/local/bin/sdks && \
chmod +x /usr/local/bin/ssl && \
chmod +x /usr/local/bin/test && \
chmod +x /usr/local/bin/vars && \

View file

@ -10,13 +10,12 @@ use Appwrite\Database\Validator\Authorization;
use Appwrite\Database\Adapter\MySQL as MySQLAdapter;
use Appwrite\Database\Adapter\Redis as RedisAdapter;
$db = $register->get('db');
$callbacks = [
'0.4.0' => function() {
Console::log('I got nothing to do.');
},
'0.5.0' => function(Document $project, $projectDB) use ($db) {
'0.5.0' => function(Document $project, $projectDB) use ($register) {
$db = $register->get('db');
Console::log('Migrating project: '.$project->getAttribute('name').' ('.$project->getId().')');

View file

@ -1,9 +1,5 @@
<?php
use Utopia\App;
use Utopia\CLI\CLI;
use Utopia\Config\Config;
use Utopia\CLI\Console;
use Appwrite\Spec\Swagger2;
@ -20,11 +16,8 @@ use Appwrite\SDK\Language\Go;
use Appwrite\SDK\Language\Java;
use Appwrite\SDK\Language\Swift;
require_once __DIR__.'/../init.php';
$cli = new CLI();
$cli
->task('generate')
->task('sdks')
->action(function () {
function getSSLPage($url)
{
@ -211,6 +204,4 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
}
exit();
});
$cli->run();
});

3
bin/sdks Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
php /usr/src/code/app/cli.php sdks $@