Add STI csv

This commit is contained in:
Inigo Flores 2016-05-04 12:52:58 +02:00
parent 7d9c165dcd
commit fe773fe167
4 changed files with 5 additions and 3 deletions

View File

@ -46,8 +46,7 @@ Si se invoca sin subcomandos o argumentos, executa:
all Procesa todas las fuentes (por defecto).
convert-to-json Convierte todo los archivos .csv en /data a .json.
convert-to-json Convierte todos los archivos .csv almacenados en /data a .json.
update Actualiza el archivo datapackage.json

View File

@ -14,6 +14,8 @@ class UpdateCommand extends ConsoleKit\Command
/**
* Actualiza datapackage.json
*
* @opt nojson no incluye los recursos .json
*
*/
public function execute(array $args, array $options = array())
{
@ -21,6 +23,7 @@ class UpdateCommand extends ConsoleKit\Command
$datapackageNew['last_updated']=date('Y-m-d ');
// Comprobobamos si hay que omitir JSON
if (!isset($options['nojson']) && !isset($options['n'])){
foreach ( Config::$datapackage['resources'] as $resource){
$resource['format'] = 'json';
@ -30,7 +33,7 @@ class UpdateCommand extends ConsoleKit\Command
}
//Nueva version
// Actualizamos versión
if (file_exists(BASE_PATH . DS . "datapackage.json")) {
$datapackageOld = json_decode(file_get_contents(BASE_PATH . DS . "datapackage.json"));
if (!empty($datapackageOld->version)) {