@worldapi/cli
Version:
A productivity focused CLI and terminal for WorldAPI.
19 lines (18 loc) • 647 B
JavaScript
import fs from "fs/promises";
import create from "../../actions/fs/create.js";
async function fileSystems_default(path) {
try {
console.log(`[World API]: Absorbing file systems from ${path}...`);
const fileSystemsFolder = await fs.readdir(`${path}/file-systems`);
let fsFiles = fileSystemsFolder.filter((file) => file.endsWith(".json"));
for (let file of fsFiles) {
await create(`${path}/file-systems/${file}`, { createDir: file.slice(0, -5) });
}
console.log(`[World API]: Absorbed file systems from ${path}!`);
} catch (error) {
return console.log(error);
}
}
export {
fileSystems_default as default
};