We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e85e714 commit f0dde4bCopy full SHA for f0dde4b
1 file changed
implement-shell-tools/ls/ls.js
@@ -1,14 +1,15 @@
1
import { promises as fs } from "node:fs";
2
async function listDir() {
3
- const flag = process.argv[2];
4
- const fileNamePattern = process.argv[3] || process.cwd();
5
- console.log(fileNamePattern);
6
- console.log(flag);
+ const flag = process.argv[2];
+ const fileNamePattern = process.argv[3] || process.cwd();
+ //console.log(fileNamePattern);
+ //console.log(flag);
7
const fileListArray = await fs.readdir(fileNamePattern);
8
- console.log(fileListArray);
9
-
+ const visibleFileListArray=fileListArray.filter(file => !file.startsWith('.'));
+ //console.log(fileListArray);
10
+ //console.log(visibleFileListArray);
11
- for(const item of fileListArray){
12
+ for(const item of visibleFileListArray){
13
console.log(item);
14
}
15
0 commit comments