mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
开发者文档
This commit is contained in:
1 parent
3e9b074e77
commit
e7ce8c1f02
42 files changed
+349
-297
No files matched your search
+3
-3
@@ -15,7 +15,7 @@ async function getInstalled() {
|
||||
const files = fs.readdirSync(root('.build/module'));
|
||||
const installed = [];
|
||||
for (const file of files) {
|
||||
if (file.endsWith('.hydro-module')) {
|
||||
if (file.endsWith('.hydro')) {
|
||||
const f = fs.readFileSync(root(`.build/module/${file}`));
|
||||
const s = fs.statSync(root(`.build/module/${file}`));
|
||||
installed.push({
|
||||
@@ -29,11 +29,11 @@ async function getInstalled() {
|
||||
}
|
||||
|
||||
async function del(id) {
|
||||
fs.unlinkSync(root(`.build/module/${id}.hydro-module`));
|
||||
fs.unlinkSync(root(`.build/module/${id}.hydro`));
|
||||
}
|
||||
|
||||
async function install(id, url) {
|
||||
await download(url, root(`module/${id}.hydro-module`));
|
||||
await download(url, root(`module/${id}.hydro`));
|
||||
}
|
||||
|
||||
module.exports = { getInstalled, del, install };
|
||||
Reference in new issue
Block a user