Skip to content

Commit 4abcb92

Browse files
committed
feat(ls): add logic to filter hidden files
1 parent 9f1261f commit 4abcb92

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ try {
2020
const filePath = filePathArg || process.cwd();
2121
let files = await fs.readdir(filePath);
2222

23-
const currentDir = process.cwd();
24-
const files = await fs.readdir(currentDir);
23+
if (!options.a) files = files.filter((file) => !file.startsWith("."));
2524

2625
if (options["1"]) {
2726
for (const file of files) {

0 commit comments

Comments
 (0)