Skip to content

Commit 58f7d44

Browse files
committed
feat: hide hidden files in ls implemention (defualt behaviour)
1 parent a2934e7 commit 58f7d44

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ const path = program.args[0] || ".";
1212
const options = program.opts();
1313
try {
1414
const files = await fs.readdir(path);
15-
console.log(files);
15+
1616
if (options.onePerLine) {
1717
for (const file of files) {
18-
console.log(file);
18+
if (!file.startsWith(".")) {
19+
console.log(file);
20+
}
1921
}
2022
}
2123
} catch (error) {

0 commit comments

Comments
 (0)