drew 6 ani în urmă
părinte
comite
4607456987
1 a modificat fișierele cu 11 adăugiri și 1 ștergeri
  1. 11 1
      icon.js

+ 11 - 1
icon.js

@@ -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"));
+}