添加附加组件开发文档

This commit is contained in:
undefined committed 2020-07-21 10:41:39 +08:00
1 parent f33690650f
commit 0f1f5f26e1
7 files changed
+242 -232

No files matched your search

-17
View File
@@ -1,17 +0,0 @@
const zlib = require('zlib');
const fs = require('fs');
async function install() {
if (!global.Hydro) throw new Error('Data missing');
if (!fs.existsSync('hydro')) fs.mkdirSync('hydro');
const hydro = JSON.parse(zlib.gunzipSync(global.Hydro).toString());
fs.writeFileSync('app.js', hydro.app);
for (const i in hydro.modules) {
fs.writeFileSync(`${i}.hydro`, Buffer.from(hydro.modules[i], 'base64'));
}
}
install().catch((e) => {
console.error(e);
process.exit(1);
});