Skip to content

Commit

Permalink
cmd-tool: corrijo bug en la generación de .yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoefe committed Oct 17, 2016
1 parent d749a82 commit fe1b45f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/txt-to-sql-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function doPrepare(params, inputYaml, create) {
if(result.errors) { throw new Error(result.errors); }
res = createParams(params, result);
if(create) {
return fs.writeFile(inputYaml, jsYaml.safeDump(res), {encoding:'utf8'});
var createdParams = Object.assign({}, res);
delete createdParams.rawTable;
return fs.writeFile(inputYaml, jsYaml.safeDump(createdParams), {encoding:'utf8'});
}
}).then(function() {
if(create) {
Expand Down Expand Up @@ -226,7 +228,9 @@ function doFast(params, inputBase) {
//console.log("preparedResult", preparedResult);
var inY = inputBase+'.yaml';
if(! fsSync.existsSync(inY)) {
fsSync.writeFile(inY, jsYaml.safeDump(createParams(params, preparedResult)), {encoding:'utf8'});
var createdParams = createParams(params, preparedResult)
delete createdParams.rawTable;
fsSync.writeFile(inY, jsYaml.safeDump(createdParams), {encoding:'utf8'});
process.stdout.write("Generated '"+inY+"' with deduced options\n");
} else {
process.stdout.write("Not overwriding existing '"+inY+"'\n");
Expand Down

0 comments on commit fe1b45f

Please sign in to comment.