diff --git a/create.js b/create.js new file mode 100644 index 0000000..c840edc --- /dev/null +++ b/create.js @@ -0,0 +1,26 @@ +import {decryptFile} from "./fileCrypto.js"; +import fs from 'fs' +import path from 'path'; +import { + fileURLToPath +} from 'url'; + +!(async () => { + let dirpath = fileURLToPath( + import.meta.url); + let abspath = path.dirname(dirpath) + let dir = fs.readdirSync(`${abspath}/parse`); + dir.forEach(async function(item, index) { + let stat = fs.lstatSync(`${abspath}/parse/` + item) + if (stat.isDirectory() === true) { + for (let script of fs.readdirSync(`${abspath}/parse/${item}`)) { + if (script.match(/\w+\_\w+\_\w/)) { + await decryptFile(`${abspath}/parse/${item}/${script}`, `${abspath}/parse/${item}/${script}`) + } + } + } + }) +})().catch((e) => { + console.log(e) +}).finally(() => { +});