docuapi 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +21 -17
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -45,31 +45,35 @@ console.log(`caminho da pasta: ${packageJsonPath}`)
|
|
|
45
45
|
|
|
46
46
|
const packageJsonRaw = fs.readFileSync(packageJsonPath, "utf-8");
|
|
47
47
|
|
|
48
|
-
console.log(packageJsonRaw)
|
|
48
|
+
//console.log(packageJsonRaw)
|
|
49
49
|
|
|
50
50
|
const packageJson = JSON.parse(packageJsonRaw);
|
|
51
51
|
|
|
52
52
|
console.log(`O projeto ${packageJson.name} na versão ${packageJson.version}, tem as seguintes dependencias:`)
|
|
53
53
|
console.log(packageJson.dependencies)
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
const IGNORE_DIRS = ["node_modules", ".git", ".vscode"];
|
|
56
|
+
|
|
57
|
+
function scanDir(dirPath, padding) {
|
|
58
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
56
59
|
|
|
57
|
-
// function scanDir(dirPath) {
|
|
58
|
-
// const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
for (const entry of entries) {
|
|
62
|
+
if (IGNORE_DIRS.includes(entry.name)) continue;
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
if (entry.isDirectory()) {
|
|
67
|
+
|
|
68
|
+
console.log(" ".repeat(padding*2), "📂", entry.name);
|
|
69
|
+
padding ++
|
|
70
|
+
scanDir(fullPath, padding);
|
|
71
|
+
padding --
|
|
72
|
+
} else {
|
|
73
|
+
console.log(" ".repeat(padding*2), "📄", entry.name);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
console.log("\n🌳 Estrutura do projeto:\n");
|
|
79
|
+
scanDir(projectRoot, 0);
|