Skip to content

Commit add67c9

Browse files
committed
add the dots in ls
1 parent 0741a9a commit add67c9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if (paths.length === 0) {
2929
// if -a flag, then include dotfiles, else exclude dotfiles
3030
function getPathEntries(path, aFlag = flags.has("a")) {
3131
let entries = fs.readdirSync(path);
32+
entries = [".", "..", entries];
3233

3334
if (!aFlag) {
3435
entries = entries.filter((e) => !e.startsWith("."));

0 commit comments

Comments
 (0)