|
|
@@ -2,7 +2,7 @@
|
|
|
const path = require("path");
|
|
|
const fs = require("fs");
|
|
|
|
|
|
-if (process.argv.length < 4) throw new Error("missing args");
|
|
|
+if (process.argv.length < 3) throw new Error("missing args");
|
|
|
const action = process.argv[2];
|
|
|
|
|
|
if (action === "copy") {
|
|
|
@@ -67,3 +67,13 @@ if (action === "rm") {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+if (action === "optimize") {
|
|
|
+ function readdir(dir) {
|
|
|
+ fs.readdirSync(dir).forEach((file) => {
|
|
|
+ const childDir = path.resolve(dir, file);
|
|
|
+ console.log(childDir);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ readdir(path.resolve(__dirname, "lib"));
|
|
|
+}
|