I write a script to collect all my .json files about 2500, and execute command "Spine -i path/to/my.json -o path/to/my.skel -e ./default.export.json" for each file.
It is so slow, because the cmd will connect the network every time. And if there are too many files, it will produce error:java.net.SocketTimeoutException: Read timed out.
Can i use some command to disable the Spine's network connect?
var wl = require("./tools/wl");
var fs = require("fs");
var path = require("path");
var exec = require("child_process").execSync;
var arg = process.argv.splice(2);
var src = arg[0];
var validFiles = [];
wl.forEachFile(src,function(file){
if(path.extname(file) != ".json"){
return;
}
var obj = JSON.parse(fs.readFileSync(file));
if(!obj.skeleton){
return;
}
validFiles.push(file);
});
for(var i=0;i<validFiles.length;++i){
var file = validFiles;
var cmd = "Spine -i "+file+" -o "+path.dirname(file)+" -e ./default.export.json";
console.log(cmd);
exec(cmd);
fs.unlinkSync(file);
}