-
-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the scripts to extract the recipes from the wiki and update the r…
…ecipes with that. Also put the output file in the arguments of the file instead of printing to stdout. I used merge_recipes.js so recipes aren't changed, just added. blocks.json and items.json aren't fully updated (see #229) so some recipes are probably still missing.
- Loading branch information
Showing
4 changed files
with
735 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
#!/usr/bin/env node | ||
if(process.argv.length!=4) | ||
if(process.argv.length!=5) | ||
{ | ||
console.log("Usage : ./merge_recipes.js <oldRecipes.json> <recipes2.json> > <newRecipes.json>"); | ||
console.log("Usage : ./merge_recipes.js <oldRecipes.json> <recipes2.json> <newRecipes.json>"); | ||
process.exit(1); | ||
} | ||
|
||
function print(o) | ||
var fs=require('fs'); | ||
var output_file=process.argv[4]; | ||
|
||
function print(o,file) | ||
{ | ||
console.log(JSON.stringify(o,null,2)); | ||
fs.writeFile(file, JSON.stringify(o,null,2), function(err) { | ||
if(err) { | ||
return console.log(err); | ||
} | ||
|
||
console.log("The file was saved!"); | ||
}); | ||
} | ||
|
||
var oldRecipes=require("./"+process.argv[2]); | ||
var transformedRecipes=require("./"+process.argv[3]); | ||
var oldRecipes=require(process.argv[2]); | ||
var transformedRecipes=require(process.argv[3]); | ||
var newRecipes=transformedRecipes; | ||
|
||
for(var i in oldRecipes) newRecipes[i]=oldRecipes[i]; | ||
|
||
print(newRecipes); | ||
print(newRecipes,output_file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.