Compare commits
2 Commits
d20c29d042
...
3e3553fd81
Author | SHA1 | Date |
---|---|---|
b1ek | 3e3553fd81 | |
b1ek | bf501ededa |
|
@ -24,10 +24,6 @@ module.exports = (argv, terminal) => {
|
||||||
|
|
||||||
directories.shift();
|
directories.shift();
|
||||||
|
|
||||||
// remove .* files if -a not specified
|
|
||||||
if (!all)
|
|
||||||
directories = directories.filter(x => !x.startsWith('.'));
|
|
||||||
|
|
||||||
// remove arguments
|
// remove arguments
|
||||||
directories = directories.filter(x => !x.startsWith('-'));
|
directories = directories.filter(x => !x.startsWith('-'));
|
||||||
|
|
||||||
|
@ -52,11 +48,14 @@ module.exports = (argv, terminal) => {
|
||||||
terminal.writeln(`${argv[0]}: cannot access '${dir}': No such file or directory`);
|
terminal.writeln(`${argv[0]}: cannot access '${dir}': No such file or directory`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let files = fs.readdirSync(dir);
|
let files = ['.', '..', ...fs.readdirSync(dir)];
|
||||||
|
if (!all)
|
||||||
|
files = files.filter(x => !x.startsWith('.'));
|
||||||
|
|
||||||
files.forEach((file, i) => {
|
files.forEach((file, i) => {
|
||||||
|
|
||||||
if (!long_format)
|
if (!long_format)
|
||||||
terminal.write(file + '\033[0m ');
|
terminal.write(file + '\033[0m\t');
|
||||||
else
|
else
|
||||||
terminal.writeln('drwx-xr-x 1 nobody nobody 4.0K Jan 1 13 01:00 ' + file);
|
terminal.writeln('drwx-xr-x 1 nobody nobody 4.0K Jan 1 13 01:00 ' + file);
|
||||||
if ((i+1) % 5 == 0)
|
if ((i+1) % 5 == 0)
|
||||||
|
|
Loading…
Reference in New Issue