simple structure
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
console.log("Dev tool running");
|
||||
console.log("Args:", args);
|
||||
console.log("CWD:", process.cwd());
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
console.log("Dev tool running");
|
||||
console.log("Args:", args);
|
||||
console.log("CWD:", process.cwd());
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export async function listWsFiles(dir: string) {
|
||||
const files: string[] = [];
|
||||
|
||||
function walk(currentDir: string) {
|
||||
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(currentDir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
walk(fullPath);
|
||||
} else if (entry.isFile() && entry.name === "ws.ts") {
|
||||
files.push(fullPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walk(dir);
|
||||
|
||||
const modules = await Promise.all(files.map((file) => import(file)));
|
||||
|
||||
return modules;
|
||||
}
|
||||
Reference in New Issue
Block a user