diff --git a/gulpfile.mjs b/gulpfile.mjs index 8dce8dce..3c150d70 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -68,21 +68,21 @@ const convert = function (from, to, ofType, overwrite = true) { } else { console.debug("processing file", join(source, file)) let originalSource = JSON.parse(readFileSync(join(source, file), {encoding: "utf8"})); - let id = randomID("DSA_4-1" + TYPE + originalSource.name.trim()); + randomID("DSA_4-1" + TYPE + originalSource.name.trim()).then(id => { - - let targetSource = { - _id: id, - _key: "!items!" + id, - type: TYPE, - img: originalSource.image, - name: originalSource.name.trim(), - system: {...originalSource}, - } - delete targetSource.system.image; - let target = JSON.stringify(targetSource, null, 2); - let newFileName = "./" + join(DEST, id + ".json"); - writeFileSync(newFileName, target, {encoding: "utf8"}); + let targetSource = { + _id: id, + _key: "!items!" + id, + type: TYPE, + img: originalSource.image, + name: originalSource.name.trim(), + system: {...originalSource}, + } + delete targetSource.system.image; + let target = JSON.stringify(targetSource, null, 2); + let newFileName = "./" + join(DEST, id + ".json"); + writeFileSync(newFileName, target, {encoding: "utf8"}); + }) } }); }