From 6c894706d46bd2c25e45715a592c85c05a8534c8 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Tue, 12 Sep 2023 09:55:29 -0400 Subject: [PATCH 01/38] feat: document and change output for --git-repos --- man/eza.1.md | 2 +- src/output/render/git.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/eza.1.md b/man/eza.1.md index 26db56c8b..b7ee90026 100644 --- a/man/eza.1.md +++ b/man/eza.1.md @@ -200,7 +200,7 @@ These options are available when running with `--long` (`-l`): This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. -Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible: if a directory contains a file that has a certain status, it will be shown to have that status. +Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible: if a directory contains a file that has a certain status, it will be shown to have that status. Symbols shown are `|` (green) for clean, `+` (red) for dirty, and `-`(green) for unknown. `--no-git` : Don't show Git status (always overrides `--git`, `--git-repos`, `--git-repos-no-status`) diff --git a/src/output/render/git.rs b/src/output/render/git.rs index d479be3bc..603f608c6 100644 --- a/src/output/render/git.rs +++ b/src/output/render/git.rs @@ -31,8 +31,8 @@ impl f::SubdirGitRepo { let s = match self.status { f::SubdirGitRepoStatus::NoRepo => style.paint("- "), f::SubdirGitRepoStatus::GitClean => style.fg(Color::Green).paint("| "), - f::SubdirGitRepoStatus::GitDirty => style.bold().fg(Color::Red).paint("- "), - f::SubdirGitRepoStatus::GitUnknown => style.paint("- "), + f::SubdirGitRepoStatus::GitDirty => style.bold().fg(Color::Red).paint("+ "), + f::SubdirGitRepoStatus::GitUnknown => style.fg(Color::Green).bold().paint("- "), }; TextCell { From 759ad06cc096c9d3838134ba7db62704164abf6f Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Tue, 12 Sep 2023 13:26:16 -0400 Subject: [PATCH 02/38] docs: add better explanation of git repos + no status --- man/eza.1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/eza.1.md b/man/eza.1.md index dc985e028..343051396 100644 --- a/man/eza.1.md +++ b/man/eza.1.md @@ -197,16 +197,16 @@ These options are available when running with `--long` (`-l`): `--git` [if eza was built with git support] : List each file’s Git status, if tracked. +This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. :Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible if a directory contains a file that has a certain status, it will be shown to have that status. `--git-repos` [if eza was built with git support] : List each directory’s Git status, if tracked. +Symbols shown are `|` (green) for clean, `+` (red) for dirty, and `-`(green) for unknown. `--git-repos-no-status` [if eza was built with git support] : List if a directory is a Git repository, but not its status. +All Git repository directories will be shown as `-` (green) without status indicated. -This adds a two-character column indicating the staged and unstaged statuses respectively. The status character can be ‘`-`’ for not modified, ‘`M`’ for a modified file, ‘`N`’ for a new file, ‘`D`’ for deleted, ‘`R`’ for renamed, ‘`T`’ for type-change, ‘`I`’ for ignored, and ‘`U`’ for conflicted. - -Directories will be shown to have the status of their contents, which is how ‘deleted’ is possible: if a directory contains a file that has a certain status, it will be shown to have that status. Symbols shown are `|` (green) for clean, `+` (red) for dirty, and `-`(green) for unknown. `--no-git` : Don't show Git status (always overrides `--git`, `--git-repos`, `--git-repos-no-status`) From 2cb92114db06f5697fcdb6a8f21a4eefdfa310b7 Mon Sep 17 00:00:00 2001 From: MartinFillon Date: Wed, 13 Sep 2023 21:22:09 +0200 Subject: [PATCH 03/38] test(QOL): Added a test generator Usage: ./generateTest --- generateTest.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 generateTest.sh diff --git a/generateTest.sh b/generateTest.sh new file mode 100755 index 000000000..7097ac807 --- /dev/null +++ b/generateTest.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Generate test data for the program + +if [ $# -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Clean up previous test data + +if [ -f tests/cmd/$1.toml ]; then + rm tests/cmd/$1.toml +fi + +if [ -f tests/cmd/$1.stdout ]; then + rm tests/cmd/$1.stdout +fi + +if [ -f tests/cmd/$1.stderr ]; then + rm tests/cmd/$1.stderr +fi + +# Generate test data + +touch tests/cmd/$1.toml + +echo 'bin.name = "eza"' >> tests/cmd/$1.toml +echo 'args = "'$2'"' >> tests/cmd/$1.toml + +# Generate expected output + +if [ -f target/debug/eza ]; then + target/debug/eza $2 > tests/cmd/$1.stdout 2> tests/cmd/$1.stderr + returncode=$? + if [ $returncode -ne 0 ]; then + echo -e 'status.code = '$returncode'' >> tests/cmd/$1.toml + exit 0 + fi +else + echo "Please build the program first" + exit 1 +fi From 20f314d2f564d8d35b18c6b06508e3d8817be563 Mon Sep 17 00:00:00 2001 From: MartinFillon Date: Wed, 13 Sep 2023 21:23:14 +0200 Subject: [PATCH 04/38] test(unix_tests): add more unix_tests --- tests/cmd/inexistant_file_unix.stderr | 1 + tests/cmd/inexistant_file_unix.stdout | 0 tests/cmd/inexistant_file_unix.toml | 3 ++ tests/cmd/long_binary_bytes_unix.stderr | 0 tests/cmd/long_binary_bytes_unix.stdout | 21 +++++++++ tests/cmd/long_binary_bytes_unix.toml | 2 + tests/cmd/long_filesize_unix.stderr | 0 tests/cmd/long_filesize_unix.stdout | 21 +++++++++ tests/cmd/long_filesize_unix.toml | 2 + tests/cmd/long_git_header_unix.stderr | 0 tests/cmd/long_git_header_unix.stdout | 22 +++++++++ tests/cmd/long_git_header_unix.toml | 2 + tests/cmd/long_header_unix.stderr | 0 tests/cmd/long_header_unix.stdout | 22 +++++++++ tests/cmd/long_header_unix.toml | 2 + tests/cmd/long_inode_unix.stderr | 0 tests/cmd/long_inode_unix.stdout | 21 +++++++++ tests/cmd/long_inode_unix.toml | 2 + tests/cmd/long_links_recurse_unix.stderr | 0 tests/cmd/long_links_recurse_unix.stdout | 47 +++++++++++++++++++ tests/cmd/long_links_recurse_unix.toml | 2 + ...long_octal_permissions_recurse_unix.stderr | 0 ...long_octal_permissions_recurse_unix.stdout | 47 +++++++++++++++++++ .../long_octal_permissions_recurse_unix.toml | 2 + tests/cmd/long_recurse_with_level_unix.stderr | 0 tests/cmd/long_recurse_with_level_unix.stdout | 21 +++++++++ tests/cmd/long_recurse_with_level_unix.toml | 2 + tests/cmd/only_dir_recursive_long_unix.stderr | 1 + tests/cmd/only_dir_recursive_long_unix.stdout | 0 tests/cmd/only_dir_recursive_long_unix.toml | 3 ++ tests/cmd/only_dir_recursive_unix.stderr | 0 tests/cmd/only_dir_recursive_unix.stdout | 21 +++++++++ tests/cmd/only_dir_recursive_unix.toml | 2 + tests/cmd/only_dir_unix.stderr | 0 tests/cmd/only_dir_unix.stdout | 2 + tests/cmd/only_dir_unix.toml | 2 + tests/cmd/recursive_long_unix.stderr | 0 tests/cmd/recursive_long_unix.stdout | 47 +++++++++++++++++++ tests/cmd/recursive_long_unix.toml | 2 + tests/cmd/recursive_unix.stderr | 0 tests/cmd/recursive_unix.stdout | 47 +++++++++++++++++++ tests/cmd/recursive_unix.toml | 2 + tests/cmd/tree_long_unix.stderr | 0 tests/cmd/tree_long_unix.stdout | 34 ++++++++++++++ tests/cmd/tree_long_unix.toml | 2 + tests/cmd/tree_unix.stderr | 0 tests/cmd/tree_unix.stdout | 34 ++++++++++++++ tests/cmd/tree_unix.toml | 2 + 48 files changed, 443 insertions(+) create mode 100644 tests/cmd/inexistant_file_unix.stderr create mode 100644 tests/cmd/inexistant_file_unix.stdout create mode 100644 tests/cmd/inexistant_file_unix.toml create mode 100644 tests/cmd/long_binary_bytes_unix.stderr create mode 100644 tests/cmd/long_binary_bytes_unix.stdout create mode 100644 tests/cmd/long_binary_bytes_unix.toml create mode 100644 tests/cmd/long_filesize_unix.stderr create mode 100644 tests/cmd/long_filesize_unix.stdout create mode 100644 tests/cmd/long_filesize_unix.toml create mode 100644 tests/cmd/long_git_header_unix.stderr create mode 100644 tests/cmd/long_git_header_unix.stdout create mode 100644 tests/cmd/long_git_header_unix.toml create mode 100644 tests/cmd/long_header_unix.stderr create mode 100644 tests/cmd/long_header_unix.stdout create mode 100644 tests/cmd/long_header_unix.toml create mode 100644 tests/cmd/long_inode_unix.stderr create mode 100644 tests/cmd/long_inode_unix.stdout create mode 100644 tests/cmd/long_inode_unix.toml create mode 100644 tests/cmd/long_links_recurse_unix.stderr create mode 100644 tests/cmd/long_links_recurse_unix.stdout create mode 100644 tests/cmd/long_links_recurse_unix.toml create mode 100644 tests/cmd/long_octal_permissions_recurse_unix.stderr create mode 100644 tests/cmd/long_octal_permissions_recurse_unix.stdout create mode 100644 tests/cmd/long_octal_permissions_recurse_unix.toml create mode 100644 tests/cmd/long_recurse_with_level_unix.stderr create mode 100644 tests/cmd/long_recurse_with_level_unix.stdout create mode 100644 tests/cmd/long_recurse_with_level_unix.toml create mode 100644 tests/cmd/only_dir_recursive_long_unix.stderr create mode 100644 tests/cmd/only_dir_recursive_long_unix.stdout create mode 100644 tests/cmd/only_dir_recursive_long_unix.toml create mode 100644 tests/cmd/only_dir_recursive_unix.stderr create mode 100644 tests/cmd/only_dir_recursive_unix.stdout create mode 100644 tests/cmd/only_dir_recursive_unix.toml create mode 100644 tests/cmd/only_dir_unix.stderr create mode 100644 tests/cmd/only_dir_unix.stdout create mode 100644 tests/cmd/only_dir_unix.toml create mode 100644 tests/cmd/recursive_long_unix.stderr create mode 100644 tests/cmd/recursive_long_unix.stdout create mode 100644 tests/cmd/recursive_long_unix.toml create mode 100644 tests/cmd/recursive_unix.stderr create mode 100644 tests/cmd/recursive_unix.stdout create mode 100644 tests/cmd/recursive_unix.toml create mode 100644 tests/cmd/tree_long_unix.stderr create mode 100644 tests/cmd/tree_long_unix.stdout create mode 100644 tests/cmd/tree_long_unix.toml create mode 100644 tests/cmd/tree_unix.stderr create mode 100644 tests/cmd/tree_unix.stdout create mode 100644 tests/cmd/tree_unix.toml diff --git a/tests/cmd/inexistant_file_unix.stderr b/tests/cmd/inexistant_file_unix.stderr new file mode 100644 index 000000000..e5536d89e --- /dev/null +++ b/tests/cmd/inexistant_file_unix.stderr @@ -0,0 +1 @@ +"nonexistentdir": No such file or directory (os error 2) diff --git a/tests/cmd/inexistant_file_unix.stdout b/tests/cmd/inexistant_file_unix.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/inexistant_file_unix.toml b/tests/cmd/inexistant_file_unix.toml new file mode 100644 index 000000000..3ab93c176 --- /dev/null +++ b/tests/cmd/inexistant_file_unix.toml @@ -0,0 +1,3 @@ +bin.name = "eza" +args = "nonexistentdir" +status.code = 2 diff --git a/tests/cmd/long_binary_bytes_unix.stderr b/tests/cmd/long_binary_bytes_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_binary_bytes_unix.stdout b/tests/cmd/long_binary_bytes_unix.stdout new file mode 100644 index 000000000..1aea11441 --- /dev/null +++ b/tests/cmd/long_binary_bytes_unix.stdout @@ -0,0 +1,21 @@ +.rw-r--r-- 0 a +.rw-r--r-- 0 b +.rw-r--r-- 0 c +.rw-r--r-- 0 d +.rw-r--r-- 0 e +drwxr-xr-x - exa +.rw-r--r-- 0 f +.rw-r--r-- 0 g +.rw-r--r-- 0 h +.rw-r--r-- 0 i +.rw-r--r-- 0 image.jpg.img.c.rs.log.png +.rw-r--r-- 19 index.svg +.rw-r--r-- 0 j +.rw-r--r-- 0 k +.rw-r--r-- 0 l +.rw-r--r-- 0 m +.rw-r--r-- 0 n +.rw-r--r-- 0 o +.rw-r--r-- 0 p +.rw-r--r-- 0 q +drwxr-xr-x - vagrant diff --git a/tests/cmd/long_binary_bytes_unix.toml b/tests/cmd/long_binary_bytes_unix.toml new file mode 100644 index 000000000..ad18ffb42 --- /dev/null +++ b/tests/cmd/long_binary_bytes_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --bytes" diff --git a/tests/cmd/long_filesize_unix.stderr b/tests/cmd/long_filesize_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_filesize_unix.stdout b/tests/cmd/long_filesize_unix.stdout new file mode 100644 index 000000000..1aea11441 --- /dev/null +++ b/tests/cmd/long_filesize_unix.stdout @@ -0,0 +1,21 @@ +.rw-r--r-- 0 a +.rw-r--r-- 0 b +.rw-r--r-- 0 c +.rw-r--r-- 0 d +.rw-r--r-- 0 e +drwxr-xr-x - exa +.rw-r--r-- 0 f +.rw-r--r-- 0 g +.rw-r--r-- 0 h +.rw-r--r-- 0 i +.rw-r--r-- 0 image.jpg.img.c.rs.log.png +.rw-r--r-- 19 index.svg +.rw-r--r-- 0 j +.rw-r--r-- 0 k +.rw-r--r-- 0 l +.rw-r--r-- 0 m +.rw-r--r-- 0 n +.rw-r--r-- 0 o +.rw-r--r-- 0 p +.rw-r--r-- 0 q +drwxr-xr-x - vagrant diff --git a/tests/cmd/long_filesize_unix.toml b/tests/cmd/long_filesize_unix.toml new file mode 100644 index 000000000..fb6ab76dd --- /dev/null +++ b/tests/cmd/long_filesize_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time" diff --git a/tests/cmd/long_git_header_unix.stderr b/tests/cmd/long_git_header_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_git_header_unix.stdout b/tests/cmd/long_git_header_unix.stdout new file mode 100644 index 000000000..201de8cb6 --- /dev/null +++ b/tests/cmd/long_git_header_unix.stdout @@ -0,0 +1,22 @@ +Permissions Git Name +.rw-r--r-- -- a +.rw-r--r-- -- b +.rw-r--r-- -- c +.rw-r--r-- -- d +.rw-r--r-- -- e +drwxr-xr-x -- exa +.rw-r--r-- -- f +.rw-r--r-- -- g +.rw-r--r-- -- h +.rw-r--r-- -- i +.rw-r--r-- -- image.jpg.img.c.rs.log.png +.rw-r--r-- -- index.svg +.rw-r--r-- -- j +.rw-r--r-- -- k +.rw-r--r-- -- l +.rw-r--r-- -- m +.rw-r--r-- -- n +.rw-r--r-- -- o +.rw-r--r-- -- p +.rw-r--r-- -- q +drwxr-xr-x -- vagrant diff --git a/tests/cmd/long_git_header_unix.toml b/tests/cmd/long_git_header_unix.toml new file mode 100644 index 000000000..bb11f0ee0 --- /dev/null +++ b/tests/cmd/long_git_header_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-filesize --git --header" diff --git a/tests/cmd/long_header_unix.stderr b/tests/cmd/long_header_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_header_unix.stdout b/tests/cmd/long_header_unix.stdout new file mode 100644 index 000000000..0c2bc6049 --- /dev/null +++ b/tests/cmd/long_header_unix.stdout @@ -0,0 +1,22 @@ +Permissions Size Name +.rw-r--r-- 0 a +.rw-r--r-- 0 b +.rw-r--r-- 0 c +.rw-r--r-- 0 d +.rw-r--r-- 0 e +drwxr-xr-x - exa +.rw-r--r-- 0 f +.rw-r--r-- 0 g +.rw-r--r-- 0 h +.rw-r--r-- 0 i +.rw-r--r-- 0 image.jpg.img.c.rs.log.png +.rw-r--r-- 19 index.svg +.rw-r--r-- 0 j +.rw-r--r-- 0 k +.rw-r--r-- 0 l +.rw-r--r-- 0 m +.rw-r--r-- 0 n +.rw-r--r-- 0 o +.rw-r--r-- 0 p +.rw-r--r-- 0 q +drwxr-xr-x - vagrant diff --git a/tests/cmd/long_header_unix.toml b/tests/cmd/long_header_unix.toml new file mode 100644 index 000000000..75e673180 --- /dev/null +++ b/tests/cmd/long_header_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --header" diff --git a/tests/cmd/long_inode_unix.stderr b/tests/cmd/long_inode_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_inode_unix.stdout b/tests/cmd/long_inode_unix.stdout new file mode 100644 index 000000000..e857d7be5 --- /dev/null +++ b/tests/cmd/long_inode_unix.stdout @@ -0,0 +1,21 @@ +395722 .rw-r--r-- a +395723 .rw-r--r-- b +395724 .rw-r--r-- c +395725 .rw-r--r-- d +395726 .rw-r--r-- e +655508 drwxr-xr-x exa +395727 .rw-r--r-- f +395728 .rw-r--r-- g +395729 .rw-r--r-- h +395730 .rw-r--r-- i +395760 .rw-r--r-- image.jpg.img.c.rs.log.png +395761 .rw-r--r-- index.svg +395731 .rw-r--r-- j +395732 .rw-r--r-- k +395733 .rw-r--r-- l +395734 .rw-r--r-- m +395735 .rw-r--r-- n +395736 .rw-r--r-- o +395737 .rw-r--r-- p +395738 .rw-r--r-- q +656744 drwxr-xr-x vagrant diff --git a/tests/cmd/long_inode_unix.toml b/tests/cmd/long_inode_unix.toml new file mode 100644 index 000000000..3e414bb67 --- /dev/null +++ b/tests/cmd/long_inode_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-filesize --inode" diff --git a/tests/cmd/long_links_recurse_unix.stderr b/tests/cmd/long_links_recurse_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_links_recurse_unix.stdout b/tests/cmd/long_links_recurse_unix.stdout new file mode 100644 index 000000000..73f19a5a1 --- /dev/null +++ b/tests/cmd/long_links_recurse_unix.stdout @@ -0,0 +1,47 @@ +.rw-r--r-- 1 a +.rw-r--r-- 1 b +.rw-r--r-- 1 c +.rw-r--r-- 1 d +.rw-r--r-- 1 e +drwxr-xr-x 3 exa +.rw-r--r-- 1 f +.rw-r--r-- 1 g +.rw-r--r-- 1 h +.rw-r--r-- 1 i +.rw-r--r-- 1 image.jpg.img.c.rs.log.png +.rw-r--r-- 1 index.svg +.rw-r--r-- 1 j +.rw-r--r-- 1 k +.rw-r--r-- 1 l +.rw-r--r-- 1 m +.rw-r--r-- 1 n +.rw-r--r-- 1 o +.rw-r--r-- 1 p +.rw-r--r-- 1 q +drwxr-xr-x 5 vagrant + +tests/itest/exa: +lrwxrwxrwx 1 file.c -> djihisudjuhfius +drwxr-xr-x 2 sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: +.rw-r--r-- 1 Makefile + +tests/itest/vagrant: +drwxr-xr-x 2 debug +drwxr-xr-x 2 dev +drwxr-xr-x 3 log + +tests/itest/vagrant/debug: +lrwxrwxrwx 1 symlinking -> a + +tests/itest/vagrant/dev: +.rw-r--r-- 1 main.bf + +tests/itest/vagrant/log: +.rw-r--r-- 1 file.png +drwxr-xr-x 2 run + +tests/itest/vagrant/log/run: +.rw-r--r-- 1 run.log.text +.rw-r--r-- 1 sps.log.text diff --git a/tests/cmd/long_links_recurse_unix.toml b/tests/cmd/long_links_recurse_unix.toml new file mode 100644 index 000000000..c1a4fa414 --- /dev/null +++ b/tests/cmd/long_links_recurse_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-filesize --links --recurse" diff --git a/tests/cmd/long_octal_permissions_recurse_unix.stderr b/tests/cmd/long_octal_permissions_recurse_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_octal_permissions_recurse_unix.stdout b/tests/cmd/long_octal_permissions_recurse_unix.stdout new file mode 100644 index 000000000..3901f32b9 --- /dev/null +++ b/tests/cmd/long_octal_permissions_recurse_unix.stdout @@ -0,0 +1,47 @@ +0644 .rw-r--r-- a +0644 .rw-r--r-- b +0644 .rw-r--r-- c +0644 .rw-r--r-- d +0644 .rw-r--r-- e +0755 drwxr-xr-x exa +0644 .rw-r--r-- f +0644 .rw-r--r-- g +0644 .rw-r--r-- h +0644 .rw-r--r-- i +0644 .rw-r--r-- image.jpg.img.c.rs.log.png +0644 .rw-r--r-- index.svg +0644 .rw-r--r-- j +0644 .rw-r--r-- k +0644 .rw-r--r-- l +0644 .rw-r--r-- m +0644 .rw-r--r-- n +0644 .rw-r--r-- o +0644 .rw-r--r-- p +0644 .rw-r--r-- q +0755 drwxr-xr-x vagrant + +tests/itest/exa: +0777 lrwxrwxrwx file.c -> djihisudjuhfius +0755 drwxr-xr-x sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: +0644 .rw-r--r-- Makefile + +tests/itest/vagrant: +0755 drwxr-xr-x debug +0755 drwxr-xr-x dev +0755 drwxr-xr-x log + +tests/itest/vagrant/debug: +0777 lrwxrwxrwx symlinking -> a + +tests/itest/vagrant/dev: +0644 .rw-r--r-- main.bf + +tests/itest/vagrant/log: +0644 .rw-r--r-- file.png +0755 drwxr-xr-x run + +tests/itest/vagrant/log/run: +0644 .rw-r--r-- run.log.text +0644 .rw-r--r-- sps.log.text diff --git a/tests/cmd/long_octal_permissions_recurse_unix.toml b/tests/cmd/long_octal_permissions_recurse_unix.toml new file mode 100644 index 000000000..123cd748f --- /dev/null +++ b/tests/cmd/long_octal_permissions_recurse_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-filesize --octal-permissions --recurse" diff --git a/tests/cmd/long_recurse_with_level_unix.stderr b/tests/cmd/long_recurse_with_level_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/long_recurse_with_level_unix.stdout b/tests/cmd/long_recurse_with_level_unix.stdout new file mode 100644 index 000000000..8a156f195 --- /dev/null +++ b/tests/cmd/long_recurse_with_level_unix.stdout @@ -0,0 +1,21 @@ +.rw-r--r-- a +.rw-r--r-- b +.rw-r--r-- c +.rw-r--r-- d +.rw-r--r-- e +drwxr-xr-x exa +.rw-r--r-- f +.rw-r--r-- g +.rw-r--r-- h +.rw-r--r-- i +.rw-r--r-- image.jpg.img.c.rs.log.png +.rw-r--r-- index.svg +.rw-r--r-- j +.rw-r--r-- k +.rw-r--r-- l +.rw-r--r-- m +.rw-r--r-- n +.rw-r--r-- o +.rw-r--r-- p +.rw-r--r-- q +drwxr-xr-x vagrant diff --git a/tests/cmd/long_recurse_with_level_unix.toml b/tests/cmd/long_recurse_with_level_unix.toml new file mode 100644 index 000000000..59d4eca26 --- /dev/null +++ b/tests/cmd/long_recurse_with_level_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-filesize --recurse --level 2" diff --git a/tests/cmd/only_dir_recursive_long_unix.stderr b/tests/cmd/only_dir_recursive_long_unix.stderr new file mode 100644 index 000000000..e163ec74d --- /dev/null +++ b/tests/cmd/only_dir_recursive_long_unix.stderr @@ -0,0 +1 @@ +eza: Unknown argument --no-file-size diff --git a/tests/cmd/only_dir_recursive_long_unix.stdout b/tests/cmd/only_dir_recursive_long_unix.stdout new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/only_dir_recursive_long_unix.toml b/tests/cmd/only_dir_recursive_long_unix.toml new file mode 100644 index 000000000..5e4aa7d17 --- /dev/null +++ b/tests/cmd/only_dir_recursive_long_unix.toml @@ -0,0 +1,3 @@ +bin.name = "eza" +args = "tests/itest --only-dirs --recurse --long --no-time --no-user --no-file-size" +status.code = 3 diff --git a/tests/cmd/only_dir_recursive_unix.stderr b/tests/cmd/only_dir_recursive_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/only_dir_recursive_unix.stdout b/tests/cmd/only_dir_recursive_unix.stdout new file mode 100644 index 000000000..8e1cb0b74 --- /dev/null +++ b/tests/cmd/only_dir_recursive_unix.stdout @@ -0,0 +1,21 @@ +exa +vagrant + +tests/itest/exa: +sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: + +tests/itest/vagrant: +debug +dev +log + +tests/itest/vagrant/debug: + +tests/itest/vagrant/dev: + +tests/itest/vagrant/log: +run + +tests/itest/vagrant/log/run: diff --git a/tests/cmd/only_dir_recursive_unix.toml b/tests/cmd/only_dir_recursive_unix.toml new file mode 100644 index 000000000..f7cce03da --- /dev/null +++ b/tests/cmd/only_dir_recursive_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --only-dirs --recurse" diff --git a/tests/cmd/only_dir_unix.stderr b/tests/cmd/only_dir_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/only_dir_unix.stdout b/tests/cmd/only_dir_unix.stdout new file mode 100644 index 000000000..2489a9247 --- /dev/null +++ b/tests/cmd/only_dir_unix.stdout @@ -0,0 +1,2 @@ +exa +vagrant diff --git a/tests/cmd/only_dir_unix.toml b/tests/cmd/only_dir_unix.toml new file mode 100644 index 000000000..acbf5740a --- /dev/null +++ b/tests/cmd/only_dir_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --only-dirs" diff --git a/tests/cmd/recursive_long_unix.stderr b/tests/cmd/recursive_long_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/recursive_long_unix.stdout b/tests/cmd/recursive_long_unix.stdout new file mode 100644 index 000000000..d003017da --- /dev/null +++ b/tests/cmd/recursive_long_unix.stdout @@ -0,0 +1,47 @@ +.rw-r--r-- a +.rw-r--r-- b +.rw-r--r-- c +.rw-r--r-- d +.rw-r--r-- e +drwxr-xr-x exa +.rw-r--r-- f +.rw-r--r-- g +.rw-r--r-- h +.rw-r--r-- i +.rw-r--r-- image.jpg.img.c.rs.log.png +.rw-r--r-- index.svg +.rw-r--r-- j +.rw-r--r-- k +.rw-r--r-- l +.rw-r--r-- m +.rw-r--r-- n +.rw-r--r-- o +.rw-r--r-- p +.rw-r--r-- q +drwxr-xr-x vagrant + +tests/itest/exa: +lrwxrwxrwx file.c -> djihisudjuhfius +drwxr-xr-x sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: +.rw-r--r-- Makefile + +tests/itest/vagrant: +drwxr-xr-x debug +drwxr-xr-x dev +drwxr-xr-x log + +tests/itest/vagrant/debug: +lrwxrwxrwx symlinking -> a + +tests/itest/vagrant/dev: +.rw-r--r-- main.bf + +tests/itest/vagrant/log: +.rw-r--r-- file.png +drwxr-xr-x run + +tests/itest/vagrant/log/run: +.rw-r--r-- run.log.text +.rw-r--r-- sps.log.text diff --git a/tests/cmd/recursive_long_unix.toml b/tests/cmd/recursive_long_unix.toml new file mode 100644 index 000000000..c9dd3a752 --- /dev/null +++ b/tests/cmd/recursive_long_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --recurse --long --no-user --no-time --no-filesize" diff --git a/tests/cmd/recursive_unix.stderr b/tests/cmd/recursive_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/recursive_unix.stdout b/tests/cmd/recursive_unix.stdout new file mode 100644 index 000000000..16313857d --- /dev/null +++ b/tests/cmd/recursive_unix.stdout @@ -0,0 +1,47 @@ +a +b +c +d +e +exa +f +g +h +i +image.jpg.img.c.rs.log.png +index.svg +j +k +l +m +n +o +p +q +vagrant + +tests/itest/exa: +file.c -> djihisudjuhfius +sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: +Makefile + +tests/itest/vagrant: +debug +dev +log + +tests/itest/vagrant/debug: +symlinking -> a + +tests/itest/vagrant/dev: +main.bf + +tests/itest/vagrant/log: +file.png +run + +tests/itest/vagrant/log/run: +run.log.text +sps.log.text diff --git a/tests/cmd/recursive_unix.toml b/tests/cmd/recursive_unix.toml new file mode 100644 index 000000000..5c8cca9e6 --- /dev/null +++ b/tests/cmd/recursive_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --recurse" diff --git a/tests/cmd/tree_long_unix.stderr b/tests/cmd/tree_long_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/tree_long_unix.stdout b/tests/cmd/tree_long_unix.stdout new file mode 100644 index 000000000..50fe962ef --- /dev/null +++ b/tests/cmd/tree_long_unix.stdout @@ -0,0 +1,34 @@ +drwxr-xr-x tests/itest +.rw-r--r-- ├── a +.rw-r--r-- ├── b +.rw-r--r-- ├── c +.rw-r--r-- ├── d +.rw-r--r-- ├── e +drwxr-xr-x ├── exa +lrwxrwxrwx │ ├── file.c -> djihisudjuhfius +drwxr-xr-x │ └── sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +.rw-r--r-- │ └── Makefile +.rw-r--r-- ├── f +.rw-r--r-- ├── g +.rw-r--r-- ├── h +.rw-r--r-- ├── i +.rw-r--r-- ├── image.jpg.img.c.rs.log.png +.rw-r--r-- ├── index.svg +.rw-r--r-- ├── j +.rw-r--r-- ├── k +.rw-r--r-- ├── l +.rw-r--r-- ├── m +.rw-r--r-- ├── n +.rw-r--r-- ├── o +.rw-r--r-- ├── p +.rw-r--r-- ├── q +drwxr-xr-x └── vagrant +drwxr-xr-x ├── debug +lrwxrwxrwx │ └── symlinking -> a +drwxr-xr-x ├── dev +.rw-r--r-- │ └── main.bf +drwxr-xr-x └── log +.rw-r--r-- ├── file.png +drwxr-xr-x └── run +.rw-r--r-- ├── run.log.text +.rw-r--r-- └── sps.log.text diff --git a/tests/cmd/tree_long_unix.toml b/tests/cmd/tree_long_unix.toml new file mode 100644 index 000000000..96a0dc428 --- /dev/null +++ b/tests/cmd/tree_long_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --tree --long --no-user --no-time --no-filesize" diff --git a/tests/cmd/tree_unix.stderr b/tests/cmd/tree_unix.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/tree_unix.stdout b/tests/cmd/tree_unix.stdout new file mode 100644 index 000000000..2ea6bd949 --- /dev/null +++ b/tests/cmd/tree_unix.stdout @@ -0,0 +1,34 @@ +tests/itest +├── a +├── b +├── c +├── d +├── e +├── exa +│ ├── file.c -> djihisudjuhfius +│ └── sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +│ └── Makefile +├── f +├── g +├── h +├── i +├── image.jpg.img.c.rs.log.png +├── index.svg +├── j +├── k +├── l +├── m +├── n +├── o +├── p +├── q +└── vagrant + ├── debug + │ └── symlinking -> a + ├── dev + │ └── main.bf + └── log + ├── file.png + └── run + ├── run.log.text + └── sps.log.text diff --git a/tests/cmd/tree_unix.toml b/tests/cmd/tree_unix.toml new file mode 100644 index 000000000..62ec7172b --- /dev/null +++ b/tests/cmd/tree_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --tree" From d35da306a90b976cc5b3a79bd81bc1a0e0596e93 Mon Sep 17 00:00:00 2001 From: Aaron Lamb Date: Fri, 8 Sep 2023 07:58:09 +0100 Subject: [PATCH 05/38] feat: Adds filtering on Windows hidden files Adds an extra check on attributes().hidden on Windows This hides Windows hidden files whenever dot files are also filtered out Resolves #212 --- src/fs/dir.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index f2d709319..9303feedb 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,11 +129,24 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) - .map_err(|e| (path.clone(), e))) + let file = File::from_args( + path.clone(), + self.dir, + filename, + self.deref_links + ).map_err(|e| (path.clone(), e)); + + // Windows has its own concept of hidden files, with a flag + // stored in the file's attributes + #[cfg(windows)] + if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { + continue; + } + + return Some(file); } - return None + return None; } } } From 33dcd088bfb1bfeb308289dcb4a04d3ef953f7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 06:26:04 +0000 Subject: [PATCH 06/38] fix: Revert "Support for Windows Hidden Files" --- src/fs/dir.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index 9303feedb..f2d709319 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,24 +129,11 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - let file = File::from_args( - path.clone(), - self.dir, - filename, - self.deref_links - ).map_err(|e| (path.clone(), e)); - - // Windows has its own concept of hidden files, with a flag - // stored in the file's attributes - #[cfg(windows)] - if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { - continue; - } - - return Some(file); + return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) + .map_err(|e| (path.clone(), e))) } - return None; + return None } } } From 7cb1ac610ebe87e018b09ae81321172b2290054b Mon Sep 17 00:00:00 2001 From: Martin Fillon Date: Thu, 14 Sep 2023 09:49:30 +0200 Subject: [PATCH 07/38] refactor(test_generator): moved generateTest.sh to devtools/ --- generateTest.sh => devtools/generateTest.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename generateTest.sh => devtools/generateTest.sh (100%) diff --git a/generateTest.sh b/devtools/generateTest.sh similarity index 100% rename from generateTest.sh rename to devtools/generateTest.sh From 2f9199cf2860a230350cd08084c10af2889674fd Mon Sep 17 00:00:00 2001 From: Martin Fillon Date: Thu, 14 Sep 2023 11:09:13 +0200 Subject: [PATCH 08/38] test(unix_tests): fixed unix tests to remove any distro specific --- tests/cmd/long_binary_bytes_unix.stdout | 42 ++++++------ tests/cmd/long_binary_bytes_unix.toml | 2 +- ...unix.stderr => long_file_size_unix.stderr} | 0 tests/cmd/long_file_size_unix.stdout | 21 ++++++ tests/cmd/long_file_size_unix.toml | 2 + tests/cmd/long_filesize_unix.stdout | 21 ------ tests/cmd/long_filesize_unix.toml | 2 - tests/cmd/long_git_header_unix.stdout | 44 ++++++------ tests/cmd/long_git_header_unix.toml | 2 +- tests/cmd/long_header_unix.stdout | 44 ++++++------ tests/cmd/long_header_unix.toml | 2 +- tests/cmd/long_inode_unix.stderr | 0 tests/cmd/long_inode_unix.stdout | 21 ------ tests/cmd/long_inode_unix.toml | 2 - tests/cmd/long_links_recurse_unix.stdout | 66 +++++++++--------- tests/cmd/long_links_recurse_unix.toml | 2 +- ...long_octal_permissions_recurse_unix.stderr | 0 ...long_octal_permissions_recurse_unix.stdout | 47 ------------- .../long_octal_permissions_recurse_unix.toml | 2 - tests/cmd/long_recurse_with_level_unix.stdout | 42 ++++++------ tests/cmd/long_recurse_with_level_unix.toml | 2 +- tests/cmd/long_unix.stdout | 42 ++++++------ tests/cmd/long_unix.toml | 2 +- tests/cmd/only_dir_recursive_long_unix.stderr | 1 - tests/cmd/only_dir_recursive_long_unix.stdout | 21 ++++++ tests/cmd/only_dir_recursive_long_unix.toml | 3 +- tests/cmd/recursive_long_unix.stdout | 66 +++++++++--------- tests/cmd/recursive_long_unix.toml | 2 +- tests/cmd/tree_long_unix.stdout | 68 +++++++++---------- tests/cmd/tree_long_unix.toml | 2 +- 30 files changed, 260 insertions(+), 313 deletions(-) rename tests/cmd/{long_filesize_unix.stderr => long_file_size_unix.stderr} (100%) create mode 100644 tests/cmd/long_file_size_unix.stdout create mode 100644 tests/cmd/long_file_size_unix.toml delete mode 100644 tests/cmd/long_filesize_unix.stdout delete mode 100644 tests/cmd/long_filesize_unix.toml delete mode 100644 tests/cmd/long_inode_unix.stderr delete mode 100644 tests/cmd/long_inode_unix.stdout delete mode 100644 tests/cmd/long_inode_unix.toml delete mode 100644 tests/cmd/long_octal_permissions_recurse_unix.stderr delete mode 100644 tests/cmd/long_octal_permissions_recurse_unix.stdout delete mode 100644 tests/cmd/long_octal_permissions_recurse_unix.toml diff --git a/tests/cmd/long_binary_bytes_unix.stdout b/tests/cmd/long_binary_bytes_unix.stdout index 1aea11441..4ad8aa333 100644 --- a/tests/cmd/long_binary_bytes_unix.stdout +++ b/tests/cmd/long_binary_bytes_unix.stdout @@ -1,21 +1,21 @@ -.rw-r--r-- 0 a -.rw-r--r-- 0 b -.rw-r--r-- 0 c -.rw-r--r-- 0 d -.rw-r--r-- 0 e -drwxr-xr-x - exa -.rw-r--r-- 0 f -.rw-r--r-- 0 g -.rw-r--r-- 0 h -.rw-r--r-- 0 i -.rw-r--r-- 0 image.jpg.img.c.rs.log.png -.rw-r--r-- 19 index.svg -.rw-r--r-- 0 j -.rw-r--r-- 0 k -.rw-r--r-- 0 l -.rw-r--r-- 0 m -.rw-r--r-- 0 n -.rw-r--r-- 0 o -.rw-r--r-- 0 p -.rw-r--r-- 0 q -drwxr-xr-x - vagrant + 0 a + 0 b + 0 c + 0 d + 0 e + - exa + 0 f + 0 g + 0 h + 0 i + 0 image.jpg.img.c.rs.log.png +19 index.svg + 0 j + 0 k + 0 l + 0 m + 0 n + 0 o + 0 p + 0 q + - vagrant diff --git a/tests/cmd/long_binary_bytes_unix.toml b/tests/cmd/long_binary_bytes_unix.toml index ad18ffb42..6669788a1 100644 --- a/tests/cmd/long_binary_bytes_unix.toml +++ b/tests/cmd/long_binary_bytes_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --bytes" +args = "tests/itest --long --no-user --no-time --no-permissions --binary" diff --git a/tests/cmd/long_filesize_unix.stderr b/tests/cmd/long_file_size_unix.stderr similarity index 100% rename from tests/cmd/long_filesize_unix.stderr rename to tests/cmd/long_file_size_unix.stderr diff --git a/tests/cmd/long_file_size_unix.stdout b/tests/cmd/long_file_size_unix.stdout new file mode 100644 index 000000000..4ad8aa333 --- /dev/null +++ b/tests/cmd/long_file_size_unix.stdout @@ -0,0 +1,21 @@ + 0 a + 0 b + 0 c + 0 d + 0 e + - exa + 0 f + 0 g + 0 h + 0 i + 0 image.jpg.img.c.rs.log.png +19 index.svg + 0 j + 0 k + 0 l + 0 m + 0 n + 0 o + 0 p + 0 q + - vagrant diff --git a/tests/cmd/long_file_size_unix.toml b/tests/cmd/long_file_size_unix.toml new file mode 100644 index 000000000..30512bb56 --- /dev/null +++ b/tests/cmd/long_file_size_unix.toml @@ -0,0 +1,2 @@ +bin.name = "eza" +args = "tests/itest --long --no-user --no-time --no-permissions" diff --git a/tests/cmd/long_filesize_unix.stdout b/tests/cmd/long_filesize_unix.stdout deleted file mode 100644 index 1aea11441..000000000 --- a/tests/cmd/long_filesize_unix.stdout +++ /dev/null @@ -1,21 +0,0 @@ -.rw-r--r-- 0 a -.rw-r--r-- 0 b -.rw-r--r-- 0 c -.rw-r--r-- 0 d -.rw-r--r-- 0 e -drwxr-xr-x - exa -.rw-r--r-- 0 f -.rw-r--r-- 0 g -.rw-r--r-- 0 h -.rw-r--r-- 0 i -.rw-r--r-- 0 image.jpg.img.c.rs.log.png -.rw-r--r-- 19 index.svg -.rw-r--r-- 0 j -.rw-r--r-- 0 k -.rw-r--r-- 0 l -.rw-r--r-- 0 m -.rw-r--r-- 0 n -.rw-r--r-- 0 o -.rw-r--r-- 0 p -.rw-r--r-- 0 q -drwxr-xr-x - vagrant diff --git a/tests/cmd/long_filesize_unix.toml b/tests/cmd/long_filesize_unix.toml deleted file mode 100644 index fb6ab76dd..000000000 --- a/tests/cmd/long_filesize_unix.toml +++ /dev/null @@ -1,2 +0,0 @@ -bin.name = "eza" -args = "tests/itest --long --no-user --no-time" diff --git a/tests/cmd/long_git_header_unix.stdout b/tests/cmd/long_git_header_unix.stdout index 201de8cb6..32af50ed9 100644 --- a/tests/cmd/long_git_header_unix.stdout +++ b/tests/cmd/long_git_header_unix.stdout @@ -1,22 +1,22 @@ -Permissions Git Name -.rw-r--r-- -- a -.rw-r--r-- -- b -.rw-r--r-- -- c -.rw-r--r-- -- d -.rw-r--r-- -- e -drwxr-xr-x -- exa -.rw-r--r-- -- f -.rw-r--r-- -- g -.rw-r--r-- -- h -.rw-r--r-- -- i -.rw-r--r-- -- image.jpg.img.c.rs.log.png -.rw-r--r-- -- index.svg -.rw-r--r-- -- j -.rw-r--r-- -- k -.rw-r--r-- -- l -.rw-r--r-- -- m -.rw-r--r-- -- n -.rw-r--r-- -- o -.rw-r--r-- -- p -.rw-r--r-- -- q -drwxr-xr-x -- vagrant +Git Name + -- a + -- b + -- c + -- d + -- e + -- exa + -- f + -- g + -- h + -- i + -- image.jpg.img.c.rs.log.png + -- index.svg + -- j + -- k + -- l + -- m + -- n + -- o + -- p + -- q + -- vagrant diff --git a/tests/cmd/long_git_header_unix.toml b/tests/cmd/long_git_header_unix.toml index bb11f0ee0..94f7a65a6 100644 --- a/tests/cmd/long_git_header_unix.toml +++ b/tests/cmd/long_git_header_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --git --header" +args = "tests/itest --long --no-user --no-time --no-filesize --git --header --no-permissions" diff --git a/tests/cmd/long_header_unix.stdout b/tests/cmd/long_header_unix.stdout index 0c2bc6049..4589ad441 100644 --- a/tests/cmd/long_header_unix.stdout +++ b/tests/cmd/long_header_unix.stdout @@ -1,22 +1,22 @@ -Permissions Size Name -.rw-r--r-- 0 a -.rw-r--r-- 0 b -.rw-r--r-- 0 c -.rw-r--r-- 0 d -.rw-r--r-- 0 e -drwxr-xr-x - exa -.rw-r--r-- 0 f -.rw-r--r-- 0 g -.rw-r--r-- 0 h -.rw-r--r-- 0 i -.rw-r--r-- 0 image.jpg.img.c.rs.log.png -.rw-r--r-- 19 index.svg -.rw-r--r-- 0 j -.rw-r--r-- 0 k -.rw-r--r-- 0 l -.rw-r--r-- 0 m -.rw-r--r-- 0 n -.rw-r--r-- 0 o -.rw-r--r-- 0 p -.rw-r--r-- 0 q -drwxr-xr-x - vagrant +Size Name + 0 a + 0 b + 0 c + 0 d + 0 e + - exa + 0 f + 0 g + 0 h + 0 i + 0 image.jpg.img.c.rs.log.png + 19 index.svg + 0 j + 0 k + 0 l + 0 m + 0 n + 0 o + 0 p + 0 q + - vagrant diff --git a/tests/cmd/long_header_unix.toml b/tests/cmd/long_header_unix.toml index 75e673180..421963773 100644 --- a/tests/cmd/long_header_unix.toml +++ b/tests/cmd/long_header_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --header" +args = "tests/itest --long --no-user --no-time --header --no-permissions" diff --git a/tests/cmd/long_inode_unix.stderr b/tests/cmd/long_inode_unix.stderr deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cmd/long_inode_unix.stdout b/tests/cmd/long_inode_unix.stdout deleted file mode 100644 index e857d7be5..000000000 --- a/tests/cmd/long_inode_unix.stdout +++ /dev/null @@ -1,21 +0,0 @@ -395722 .rw-r--r-- a -395723 .rw-r--r-- b -395724 .rw-r--r-- c -395725 .rw-r--r-- d -395726 .rw-r--r-- e -655508 drwxr-xr-x exa -395727 .rw-r--r-- f -395728 .rw-r--r-- g -395729 .rw-r--r-- h -395730 .rw-r--r-- i -395760 .rw-r--r-- image.jpg.img.c.rs.log.png -395761 .rw-r--r-- index.svg -395731 .rw-r--r-- j -395732 .rw-r--r-- k -395733 .rw-r--r-- l -395734 .rw-r--r-- m -395735 .rw-r--r-- n -395736 .rw-r--r-- o -395737 .rw-r--r-- p -395738 .rw-r--r-- q -656744 drwxr-xr-x vagrant diff --git a/tests/cmd/long_inode_unix.toml b/tests/cmd/long_inode_unix.toml deleted file mode 100644 index 3e414bb67..000000000 --- a/tests/cmd/long_inode_unix.toml +++ /dev/null @@ -1,2 +0,0 @@ -bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --inode" diff --git a/tests/cmd/long_links_recurse_unix.stdout b/tests/cmd/long_links_recurse_unix.stdout index 73f19a5a1..4d41d1a1a 100644 --- a/tests/cmd/long_links_recurse_unix.stdout +++ b/tests/cmd/long_links_recurse_unix.stdout @@ -1,47 +1,47 @@ -.rw-r--r-- 1 a -.rw-r--r-- 1 b -.rw-r--r-- 1 c -.rw-r--r-- 1 d -.rw-r--r-- 1 e -drwxr-xr-x 3 exa -.rw-r--r-- 1 f -.rw-r--r-- 1 g -.rw-r--r-- 1 h -.rw-r--r-- 1 i -.rw-r--r-- 1 image.jpg.img.c.rs.log.png -.rw-r--r-- 1 index.svg -.rw-r--r-- 1 j -.rw-r--r-- 1 k -.rw-r--r-- 1 l -.rw-r--r-- 1 m -.rw-r--r-- 1 n -.rw-r--r-- 1 o -.rw-r--r-- 1 p -.rw-r--r-- 1 q -drwxr-xr-x 5 vagrant +1 a +1 b +1 c +1 d +1 e +3 exa +1 f +1 g +1 h +1 i +1 image.jpg.img.c.rs.log.png +1 index.svg +1 j +1 k +1 l +1 m +1 n +1 o +1 p +1 q +5 vagrant tests/itest/exa: -lrwxrwxrwx 1 file.c -> djihisudjuhfius -drwxr-xr-x 2 sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +1 file.c -> djihisudjuhfius +2 sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: -.rw-r--r-- 1 Makefile +1 Makefile tests/itest/vagrant: -drwxr-xr-x 2 debug -drwxr-xr-x 2 dev -drwxr-xr-x 3 log +2 debug +2 dev +3 log tests/itest/vagrant/debug: -lrwxrwxrwx 1 symlinking -> a +1 symlinking -> a tests/itest/vagrant/dev: -.rw-r--r-- 1 main.bf +1 main.bf tests/itest/vagrant/log: -.rw-r--r-- 1 file.png -drwxr-xr-x 2 run +1 file.png +2 run tests/itest/vagrant/log/run: -.rw-r--r-- 1 run.log.text -.rw-r--r-- 1 sps.log.text +1 run.log.text +1 sps.log.text diff --git a/tests/cmd/long_links_recurse_unix.toml b/tests/cmd/long_links_recurse_unix.toml index c1a4fa414..6be95c6d2 100644 --- a/tests/cmd/long_links_recurse_unix.toml +++ b/tests/cmd/long_links_recurse_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --links --recurse" +args = "tests/itest --long --no-user --no-time --no-filesize --no-permissions --recurse --links" diff --git a/tests/cmd/long_octal_permissions_recurse_unix.stderr b/tests/cmd/long_octal_permissions_recurse_unix.stderr deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cmd/long_octal_permissions_recurse_unix.stdout b/tests/cmd/long_octal_permissions_recurse_unix.stdout deleted file mode 100644 index 3901f32b9..000000000 --- a/tests/cmd/long_octal_permissions_recurse_unix.stdout +++ /dev/null @@ -1,47 +0,0 @@ -0644 .rw-r--r-- a -0644 .rw-r--r-- b -0644 .rw-r--r-- c -0644 .rw-r--r-- d -0644 .rw-r--r-- e -0755 drwxr-xr-x exa -0644 .rw-r--r-- f -0644 .rw-r--r-- g -0644 .rw-r--r-- h -0644 .rw-r--r-- i -0644 .rw-r--r-- image.jpg.img.c.rs.log.png -0644 .rw-r--r-- index.svg -0644 .rw-r--r-- j -0644 .rw-r--r-- k -0644 .rw-r--r-- l -0644 .rw-r--r-- m -0644 .rw-r--r-- n -0644 .rw-r--r-- o -0644 .rw-r--r-- p -0644 .rw-r--r-- q -0755 drwxr-xr-x vagrant - -tests/itest/exa: -0777 lrwxrwxrwx file.c -> djihisudjuhfius -0755 drwxr-xr-x sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss - -tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: -0644 .rw-r--r-- Makefile - -tests/itest/vagrant: -0755 drwxr-xr-x debug -0755 drwxr-xr-x dev -0755 drwxr-xr-x log - -tests/itest/vagrant/debug: -0777 lrwxrwxrwx symlinking -> a - -tests/itest/vagrant/dev: -0644 .rw-r--r-- main.bf - -tests/itest/vagrant/log: -0644 .rw-r--r-- file.png -0755 drwxr-xr-x run - -tests/itest/vagrant/log/run: -0644 .rw-r--r-- run.log.text -0644 .rw-r--r-- sps.log.text diff --git a/tests/cmd/long_octal_permissions_recurse_unix.toml b/tests/cmd/long_octal_permissions_recurse_unix.toml deleted file mode 100644 index 123cd748f..000000000 --- a/tests/cmd/long_octal_permissions_recurse_unix.toml +++ /dev/null @@ -1,2 +0,0 @@ -bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --octal-permissions --recurse" diff --git a/tests/cmd/long_recurse_with_level_unix.stdout b/tests/cmd/long_recurse_with_level_unix.stdout index 8a156f195..a61f5881f 100644 --- a/tests/cmd/long_recurse_with_level_unix.stdout +++ b/tests/cmd/long_recurse_with_level_unix.stdout @@ -1,21 +1,21 @@ -.rw-r--r-- a -.rw-r--r-- b -.rw-r--r-- c -.rw-r--r-- d -.rw-r--r-- e -drwxr-xr-x exa -.rw-r--r-- f -.rw-r--r-- g -.rw-r--r-- h -.rw-r--r-- i -.rw-r--r-- image.jpg.img.c.rs.log.png -.rw-r--r-- index.svg -.rw-r--r-- j -.rw-r--r-- k -.rw-r--r-- l -.rw-r--r-- m -.rw-r--r-- n -.rw-r--r-- o -.rw-r--r-- p -.rw-r--r-- q -drwxr-xr-x vagrant +a +b +c +d +e +exa +f +g +h +i +image.jpg.img.c.rs.log.png +index.svg +j +k +l +m +n +o +p +q +vagrant diff --git a/tests/cmd/long_recurse_with_level_unix.toml b/tests/cmd/long_recurse_with_level_unix.toml index 59d4eca26..1c6b2c47f 100644 --- a/tests/cmd/long_recurse_with_level_unix.toml +++ b/tests/cmd/long_recurse_with_level_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --recurse --level 2" +args = "tests/itest --long --no-user --no-permissions --no-time --no-filesize --recurse --level 2" diff --git a/tests/cmd/long_unix.stdout b/tests/cmd/long_unix.stdout index 8a156f195..a61f5881f 100644 --- a/tests/cmd/long_unix.stdout +++ b/tests/cmd/long_unix.stdout @@ -1,21 +1,21 @@ -.rw-r--r-- a -.rw-r--r-- b -.rw-r--r-- c -.rw-r--r-- d -.rw-r--r-- e -drwxr-xr-x exa -.rw-r--r-- f -.rw-r--r-- g -.rw-r--r-- h -.rw-r--r-- i -.rw-r--r-- image.jpg.img.c.rs.log.png -.rw-r--r-- index.svg -.rw-r--r-- j -.rw-r--r-- k -.rw-r--r-- l -.rw-r--r-- m -.rw-r--r-- n -.rw-r--r-- o -.rw-r--r-- p -.rw-r--r-- q -drwxr-xr-x vagrant +a +b +c +d +e +exa +f +g +h +i +image.jpg.img.c.rs.log.png +index.svg +j +k +l +m +n +o +p +q +vagrant diff --git a/tests/cmd/long_unix.toml b/tests/cmd/long_unix.toml index 8ea21e7a3..396b622af 100644 --- a/tests/cmd/long_unix.toml +++ b/tests/cmd/long_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize" +args = "tests/itest --long --no-user --no-time --no-filesize --no-permissions" diff --git a/tests/cmd/only_dir_recursive_long_unix.stderr b/tests/cmd/only_dir_recursive_long_unix.stderr index e163ec74d..e69de29bb 100644 --- a/tests/cmd/only_dir_recursive_long_unix.stderr +++ b/tests/cmd/only_dir_recursive_long_unix.stderr @@ -1 +0,0 @@ -eza: Unknown argument --no-file-size diff --git a/tests/cmd/only_dir_recursive_long_unix.stdout b/tests/cmd/only_dir_recursive_long_unix.stdout index e69de29bb..8e1cb0b74 100644 --- a/tests/cmd/only_dir_recursive_long_unix.stdout +++ b/tests/cmd/only_dir_recursive_long_unix.stdout @@ -0,0 +1,21 @@ +exa +vagrant + +tests/itest/exa: +sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss + +tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: + +tests/itest/vagrant: +debug +dev +log + +tests/itest/vagrant/debug: + +tests/itest/vagrant/dev: + +tests/itest/vagrant/log: +run + +tests/itest/vagrant/log/run: diff --git a/tests/cmd/only_dir_recursive_long_unix.toml b/tests/cmd/only_dir_recursive_long_unix.toml index 5e4aa7d17..f7c2a1dd5 100644 --- a/tests/cmd/only_dir_recursive_long_unix.toml +++ b/tests/cmd/only_dir_recursive_long_unix.toml @@ -1,3 +1,2 @@ bin.name = "eza" -args = "tests/itest --only-dirs --recurse --long --no-time --no-user --no-file-size" -status.code = 3 +args = "tests/itest --recurse --long --no-user --no-time --no-filesize --no-permissions --only-dirs" diff --git a/tests/cmd/recursive_long_unix.stdout b/tests/cmd/recursive_long_unix.stdout index d003017da..16313857d 100644 --- a/tests/cmd/recursive_long_unix.stdout +++ b/tests/cmd/recursive_long_unix.stdout @@ -1,47 +1,47 @@ -.rw-r--r-- a -.rw-r--r-- b -.rw-r--r-- c -.rw-r--r-- d -.rw-r--r-- e -drwxr-xr-x exa -.rw-r--r-- f -.rw-r--r-- g -.rw-r--r-- h -.rw-r--r-- i -.rw-r--r-- image.jpg.img.c.rs.log.png -.rw-r--r-- index.svg -.rw-r--r-- j -.rw-r--r-- k -.rw-r--r-- l -.rw-r--r-- m -.rw-r--r-- n -.rw-r--r-- o -.rw-r--r-- p -.rw-r--r-- q -drwxr-xr-x vagrant +a +b +c +d +e +exa +f +g +h +i +image.jpg.img.c.rs.log.png +index.svg +j +k +l +m +n +o +p +q +vagrant tests/itest/exa: -lrwxrwxrwx file.c -> djihisudjuhfius -drwxr-xr-x sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +file.c -> djihisudjuhfius +sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: -.rw-r--r-- Makefile +Makefile tests/itest/vagrant: -drwxr-xr-x debug -drwxr-xr-x dev -drwxr-xr-x log +debug +dev +log tests/itest/vagrant/debug: -lrwxrwxrwx symlinking -> a +symlinking -> a tests/itest/vagrant/dev: -.rw-r--r-- main.bf +main.bf tests/itest/vagrant/log: -.rw-r--r-- file.png -drwxr-xr-x run +file.png +run tests/itest/vagrant/log/run: -.rw-r--r-- run.log.text -.rw-r--r-- sps.log.text +run.log.text +sps.log.text diff --git a/tests/cmd/recursive_long_unix.toml b/tests/cmd/recursive_long_unix.toml index c9dd3a752..bb21a3b28 100644 --- a/tests/cmd/recursive_long_unix.toml +++ b/tests/cmd/recursive_long_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --recurse --long --no-user --no-time --no-filesize" +args = "tests/itest --recurse --long --no-user --no-time --no-filesize --no-permissions" diff --git a/tests/cmd/tree_long_unix.stdout b/tests/cmd/tree_long_unix.stdout index 50fe962ef..2ea6bd949 100644 --- a/tests/cmd/tree_long_unix.stdout +++ b/tests/cmd/tree_long_unix.stdout @@ -1,34 +1,34 @@ -drwxr-xr-x tests/itest -.rw-r--r-- ├── a -.rw-r--r-- ├── b -.rw-r--r-- ├── c -.rw-r--r-- ├── d -.rw-r--r-- ├── e -drwxr-xr-x ├── exa -lrwxrwxrwx │ ├── file.c -> djihisudjuhfius -drwxr-xr-x │ └── sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss -.rw-r--r-- │ └── Makefile -.rw-r--r-- ├── f -.rw-r--r-- ├── g -.rw-r--r-- ├── h -.rw-r--r-- ├── i -.rw-r--r-- ├── image.jpg.img.c.rs.log.png -.rw-r--r-- ├── index.svg -.rw-r--r-- ├── j -.rw-r--r-- ├── k -.rw-r--r-- ├── l -.rw-r--r-- ├── m -.rw-r--r-- ├── n -.rw-r--r-- ├── o -.rw-r--r-- ├── p -.rw-r--r-- ├── q -drwxr-xr-x └── vagrant -drwxr-xr-x ├── debug -lrwxrwxrwx │ └── symlinking -> a -drwxr-xr-x ├── dev -.rw-r--r-- │ └── main.bf -drwxr-xr-x └── log -.rw-r--r-- ├── file.png -drwxr-xr-x └── run -.rw-r--r-- ├── run.log.text -.rw-r--r-- └── sps.log.text +tests/itest +├── a +├── b +├── c +├── d +├── e +├── exa +│ ├── file.c -> djihisudjuhfius +│ └── sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +│ └── Makefile +├── f +├── g +├── h +├── i +├── image.jpg.img.c.rs.log.png +├── index.svg +├── j +├── k +├── l +├── m +├── n +├── o +├── p +├── q +└── vagrant + ├── debug + │ └── symlinking -> a + ├── dev + │ └── main.bf + └── log + ├── file.png + └── run + ├── run.log.text + └── sps.log.text diff --git a/tests/cmd/tree_long_unix.toml b/tests/cmd/tree_long_unix.toml index 96a0dc428..dc3930dd4 100644 --- a/tests/cmd/tree_long_unix.toml +++ b/tests/cmd/tree_long_unix.toml @@ -1,2 +1,2 @@ bin.name = "eza" -args = "tests/itest --tree --long --no-user --no-time --no-filesize" +args = "tests/itest --tree --long --no-user --no-time --no-filesize --no-permissions" From 2cc52f333db5936981a71e54355f46258b5ad375 Mon Sep 17 00:00:00 2001 From: Aaron Lamb Date: Fri, 8 Sep 2023 07:58:09 +0100 Subject: [PATCH 09/38] feat: Adds filtering on Windows hidden files Adds an extra check on attributes().hidden on Windows This hides Windows hidden files whenever dot files are also filtered out Resolves #212 --- src/fs/dir.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index f2d709319..9303feedb 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,11 +129,24 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) - .map_err(|e| (path.clone(), e))) + let file = File::from_args( + path.clone(), + self.dir, + filename, + self.deref_links + ).map_err(|e| (path.clone(), e)); + + // Windows has its own concept of hidden files, with a flag + // stored in the file's attributes + #[cfg(windows)] + if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { + continue; + } + + return Some(file); } - return None + return None; } } } From da489e0f4008c4207f0464022aa8bfb00b1f51c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 06:26:04 +0000 Subject: [PATCH 10/38] Revert: "Support for Windows Hidden Files" --- src/fs/dir.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index 9303feedb..f2d709319 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,24 +129,11 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - let file = File::from_args( - path.clone(), - self.dir, - filename, - self.deref_links - ).map_err(|e| (path.clone(), e)); - - // Windows has its own concept of hidden files, with a flag - // stored in the file's attributes - #[cfg(windows)] - if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { - continue; - } - - return Some(file); + return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) + .map_err(|e| (path.clone(), e))) } - return None; + return None } } } From 77c9f7c7f5c3cf18021eafb95757b9e49365a017 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Wed, 13 Sep 2023 07:21:01 +0200 Subject: [PATCH 11/38] fix: shellcheck warnings --- devtools/deb-package.sh | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/devtools/deb-package.sh b/devtools/deb-package.sh index 8ec278d81..3ac0efdfd 100755 --- a/devtools/deb-package.sh +++ b/devtools/deb-package.sh @@ -9,7 +9,7 @@ TAG=$(git describe --tags --abbrev=0) VERSION=${TAG:1} echo "checkout tag ${TAG}" -git checkout --quiet ${TAG} +git checkout --quiet "${TAG}" echo "build man pages" just man @@ -20,7 +20,7 @@ TARGETS["arm64"]="aarch64-unknown-linux-gnu" TARGETS["armhf"]="arm-unknown-linux-gnueabihf" echo "download release notes" -RELEASE_NOTES=$(curl -s ${REPO_URL}/releases/tag/${TAG}) +RELEASE_NOTES=$(curl -s ${REPO_URL}/releases/tag/"${TAG}") for ARCH in "${!TARGETS[@]}"; do echo "building ${ARCH} package:" @@ -40,29 +40,29 @@ for ARCH in "${!TARGETS[@]}"; do echo " checksum ok" echo " -> creating directory structure" - mkdir -p ${DEB_TMP_DIR} - mkdir -p ${DEB_TMP_DIR}${DESTDIR} - mkdir -p ${DEB_TMP_DIR}${DOCDIR} - mkdir -p ${DEB_TMP_DIR}${DOCDIR}/man1 - mkdir -p ${DEB_TMP_DIR}${DOCDIR}/man5 - mkdir -p ${DEB_TMP_DIR}/DEBIAN - mkdir -p ${DEB_TMP_DIR}/usr/share/doc/${NAME} - chmod 755 -R ${DEB_TMP_DIR} + mkdir -p "${DEB_TMP_DIR}" + mkdir -p "${DEB_TMP_DIR}"${DESTDIR} + mkdir -p "${DEB_TMP_DIR}"${DOCDIR} + mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man1 + mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man5 + mkdir -p "${DEB_TMP_DIR}"/DEBIAN + mkdir -p "${DEB_TMP_DIR}"/usr/share/doc/${NAME} + chmod 755 -R "${DEB_TMP_DIR}" echo " -> extract executable" tar -xzf "${ARCH}.tar.gz" - cp ${NAME} ${DEB_TMP_DIR}${DESTDIR} - chmod 755 ${DEB_TMP_DIR}${DESTDIR}/${NAME} + cp ${NAME} "${DEB_TMP_DIR}"${DESTDIR} + chmod 755 "${DEB_TMP_DIR}"${DESTDIR}/${NAME} echo " -> compress man pages" - gzip -cn9 target/man/eza.1 > ${DEB_TMP_DIR}${DOCDIR}man1/eza.1.gz - gzip -cn9 target/man/eza_colors.5 > ${DEB_TMP_DIR}${DOCDIR}man5/eza_colors.5.gz - gzip -cn9 target/man/eza_colors-explanation.5 > ${DEB_TMP_DIR}${DOCDIR}man5/eza_colors-explanation.5.gz - chmod 644 ${DEB_TMP_DIR}${DOCDIR}/**/*.gz + gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}"${DOCDIR}man1/eza.1.gz + gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors.5.gz + gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors-explanation.5.gz + chmod 644 "${DEB_TMP_DIR}"${DOCDIR}/**/*.gz echo " -> create control file" - touch ${DEB_TMP_DIR}/DEBIAN/control - cat > ${DEB_TMP_DIR}/DEBIAN/control < "${DEB_TMP_DIR}"/DEBIAN/control < copy changelog" - cp CHANGELOG.md ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog - gzip -cn9 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog > ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz - rm ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog - chmod 644 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz + cp CHANGELOG.md "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog + gzip -cn9 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz + rm "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog + chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz echo " -> create copyright file" - touch ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright - cat > ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright << EOM + touch "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright + cat > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright << EOM Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ${NAME} Upstream-Contact: Christina Sørensen @@ -121,16 +121,16 @@ License: MIT OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOM - chmod 644 ${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright + chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright echo " -> build ${ARCH} package" - dpkg-deb --build --root-owner-group ${DEB_TMP_DIR} > /dev/null + dpkg-deb --build --root-owner-group "${DEB_TMP_DIR}" > /dev/null echo " -> cleanup" - rm -rf ${DEB_TMP_DIR} ${ARCH}.tar.gz ${NAME} + rm -rf "${DEB_TMP_DIR}" "${ARCH}".tar.gz ${NAME} # gierens: this does not work on my arch at the moment and # i'm verifying on the repo host anyway thus the || true echo " -> lint ${ARCH} package" - lintian ${DEB_PACKAGE} || true + lintian "${DEB_PACKAGE}" || true done From 14c7d948d118f9fe925b0d63eff878e3e351a6e2 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Wed, 13 Sep 2023 21:22:34 +0200 Subject: [PATCH 12/38] feat: added shellcheck to treefmt --- treefmt.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/treefmt.nix b/treefmt.nix index 9ea5c043c..fc57580bf 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -3,5 +3,6 @@ programs = { alejandra.enable = true; rustfmt.enable = true; + shellcheck.enable = true; }; } From cc05ea01c7bf14a7b23f3d6b0c1a488fb71432fe Mon Sep 17 00:00:00 2001 From: Sandro-Alessio Gierens Date: Thu, 14 Sep 2023 08:32:15 +0200 Subject: [PATCH 13/38] style(devtools): fix shellcheck issues in deb-package.sh Signed-off-by: Sandro-Alessio Gierens --- devtools/deb-package.sh | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/devtools/deb-package.sh b/devtools/deb-package.sh index 3ac0efdfd..d67fef6f5 100755 --- a/devtools/deb-package.sh +++ b/devtools/deb-package.sh @@ -20,7 +20,7 @@ TARGETS["arm64"]="aarch64-unknown-linux-gnu" TARGETS["armhf"]="arm-unknown-linux-gnueabihf" echo "download release notes" -RELEASE_NOTES=$(curl -s ${REPO_URL}/releases/tag/"${TAG}") +RELEASE_NOTES=$(curl -s "${REPO_URL}/releases/tag/${TAG}") for ARCH in "${!TARGETS[@]}"; do echo "building ${ARCH} package:" @@ -41,28 +41,28 @@ for ARCH in "${!TARGETS[@]}"; do echo " -> creating directory structure" mkdir -p "${DEB_TMP_DIR}" - mkdir -p "${DEB_TMP_DIR}"${DESTDIR} - mkdir -p "${DEB_TMP_DIR}"${DOCDIR} - mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man1 - mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man5 - mkdir -p "${DEB_TMP_DIR}"/DEBIAN - mkdir -p "${DEB_TMP_DIR}"/usr/share/doc/${NAME} + mkdir -p "${DEB_TMP_DIR}${DESTDIR}" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man1" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man5" + mkdir -p "${DEB_TMP_DIR}/DEBIAN" + mkdir -p "${DEB_TMP_DIR}/usr/share/doc/${NAME}" chmod 755 -R "${DEB_TMP_DIR}" - + echo " -> extract executable" tar -xzf "${ARCH}.tar.gz" - cp ${NAME} "${DEB_TMP_DIR}"${DESTDIR} - chmod 755 "${DEB_TMP_DIR}"${DESTDIR}/${NAME} + cp ${NAME} "${DEB_TMP_DIR}${DESTDIR}" + chmod 755 "${DEB_TMP_DIR}${DESTDIR}/${NAME}" echo " -> compress man pages" - gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}"${DOCDIR}man1/eza.1.gz - gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors.5.gz - gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors-explanation.5.gz - chmod 644 "${DEB_TMP_DIR}"${DOCDIR}/**/*.gz - + gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}${DOCDIR}man1/eza.1.gz" + gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors.5.gz" + gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors-explanation.5.gz" + chmod 644 "${DEB_TMP_DIR}${DOCDIR}"/**/*.gz + echo " -> create control file" - touch "${DEB_TMP_DIR}"/DEBIAN/control - cat > "${DEB_TMP_DIR}"/DEBIAN/control < "${DEB_TMP_DIR}/DEBIAN/control" < copy changelog" - cp CHANGELOG.md "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog - gzip -cn9 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz - rm "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog - chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz - + cp CHANGELOG.md "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" + gzip -cn9 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" + rm "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" + chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" + echo " -> create copyright file" - touch "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright - cat > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright << EOM + touch "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" + cat > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" << EOM Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ${NAME} Upstream-Contact: Christina Sørensen @@ -121,14 +121,14 @@ License: MIT OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOM - chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright - + chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" + echo " -> build ${ARCH} package" dpkg-deb --build --root-owner-group "${DEB_TMP_DIR}" > /dev/null - + echo " -> cleanup" - rm -rf "${DEB_TMP_DIR}" "${ARCH}".tar.gz ${NAME} - + rm -rf "${DEB_TMP_DIR}" "${ARCH}.tar.gz" "${NAME}" + # gierens: this does not work on my arch at the moment and # i'm verifying on the repo host anyway thus the || true echo " -> lint ${ARCH} package" From 0bed0dc0e3b6f0ec2ff0b5b98578025ebe63056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 10:56:59 +0200 Subject: [PATCH 14/38] ci(convco): enforce conventional commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- .github/workflows/conventional-commits.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/conventional-commits.yml diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 000000000..b860275c1 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,19 @@ +name: Conventional Commits + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: webiny/action-conventional-commits@v1.1.0 + # optional, required for private repos + # with: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 63e2bd745ced9a8e5e1fa22dc549282c6b48f48b Mon Sep 17 00:00:00 2001 From: Martin Fillon Date: Thu, 14 Sep 2023 13:24:44 +0200 Subject: [PATCH 15/38] refactor(test_generator): renamed the file --- devtools/{generateTest.sh => generate-trycmd-test.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename devtools/{generateTest.sh => generate-trycmd-test.sh} (100%) diff --git a/devtools/generateTest.sh b/devtools/generate-trycmd-test.sh similarity index 100% rename from devtools/generateTest.sh rename to devtools/generate-trycmd-test.sh From 90559a0bb37c6c9ba52cb9deecc59e08df3a4f70 Mon Sep 17 00:00:00 2001 From: Aaron Lamb Date: Fri, 8 Sep 2023 07:58:09 +0100 Subject: [PATCH 16/38] feat: Adds filtering on Windows hidden files Adds an extra check on attributes().hidden on Windows This hides Windows hidden files whenever dot files are also filtered out Resolves #212 --- src/fs/dir.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index f2d709319..9303feedb 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,11 +129,24 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) - .map_err(|e| (path.clone(), e))) + let file = File::from_args( + path.clone(), + self.dir, + filename, + self.deref_links + ).map_err(|e| (path.clone(), e)); + + // Windows has its own concept of hidden files, with a flag + // stored in the file's attributes + #[cfg(windows)] + if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { + continue; + } + + return Some(file); } - return None + return None; } } } From 0d85615b9a58dd5785a17db0aa96ca350d07cd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 06:26:04 +0000 Subject: [PATCH 17/38] fix: Revert "Support for Windows Hidden Files" --- src/fs/dir.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index 9303feedb..f2d709319 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -129,24 +129,11 @@ impl<'dir, 'ig> Files<'dir, 'ig> { } } - let file = File::from_args( - path.clone(), - self.dir, - filename, - self.deref_links - ).map_err(|e| (path.clone(), e)); - - // Windows has its own concept of hidden files, with a flag - // stored in the file's attributes - #[cfg(windows)] - if !self.dotfiles && file.as_ref().is_ok_and(|f| f.attributes().hidden) { - continue; - } - - return Some(file); + return Some(File::from_args(path.clone(), self.dir, filename, self.deref_links) + .map_err(|e| (path.clone(), e))) } - return None; + return None } } } From 51e85898af33bf45ca7cb7d1cb9abb74ea640552 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Wed, 13 Sep 2023 07:21:01 +0200 Subject: [PATCH 18/38] fix: shellcheck warnings --- devtools/deb-package.sh | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/devtools/deb-package.sh b/devtools/deb-package.sh index d67fef6f5..3ac0efdfd 100755 --- a/devtools/deb-package.sh +++ b/devtools/deb-package.sh @@ -20,7 +20,7 @@ TARGETS["arm64"]="aarch64-unknown-linux-gnu" TARGETS["armhf"]="arm-unknown-linux-gnueabihf" echo "download release notes" -RELEASE_NOTES=$(curl -s "${REPO_URL}/releases/tag/${TAG}") +RELEASE_NOTES=$(curl -s ${REPO_URL}/releases/tag/"${TAG}") for ARCH in "${!TARGETS[@]}"; do echo "building ${ARCH} package:" @@ -41,28 +41,28 @@ for ARCH in "${!TARGETS[@]}"; do echo " -> creating directory structure" mkdir -p "${DEB_TMP_DIR}" - mkdir -p "${DEB_TMP_DIR}${DESTDIR}" - mkdir -p "${DEB_TMP_DIR}${DOCDIR}" - mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man1" - mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man5" - mkdir -p "${DEB_TMP_DIR}/DEBIAN" - mkdir -p "${DEB_TMP_DIR}/usr/share/doc/${NAME}" + mkdir -p "${DEB_TMP_DIR}"${DESTDIR} + mkdir -p "${DEB_TMP_DIR}"${DOCDIR} + mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man1 + mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man5 + mkdir -p "${DEB_TMP_DIR}"/DEBIAN + mkdir -p "${DEB_TMP_DIR}"/usr/share/doc/${NAME} chmod 755 -R "${DEB_TMP_DIR}" - + echo " -> extract executable" tar -xzf "${ARCH}.tar.gz" - cp ${NAME} "${DEB_TMP_DIR}${DESTDIR}" - chmod 755 "${DEB_TMP_DIR}${DESTDIR}/${NAME}" + cp ${NAME} "${DEB_TMP_DIR}"${DESTDIR} + chmod 755 "${DEB_TMP_DIR}"${DESTDIR}/${NAME} echo " -> compress man pages" - gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}${DOCDIR}man1/eza.1.gz" - gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors.5.gz" - gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors-explanation.5.gz" - chmod 644 "${DEB_TMP_DIR}${DOCDIR}"/**/*.gz - + gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}"${DOCDIR}man1/eza.1.gz + gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors.5.gz + gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors-explanation.5.gz + chmod 644 "${DEB_TMP_DIR}"${DOCDIR}/**/*.gz + echo " -> create control file" - touch "${DEB_TMP_DIR}/DEBIAN/control" - cat > "${DEB_TMP_DIR}/DEBIAN/control" < "${DEB_TMP_DIR}"/DEBIAN/control < copy changelog" - cp CHANGELOG.md "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" - gzip -cn9 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" - rm "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" - chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" - + cp CHANGELOG.md "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog + gzip -cn9 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz + rm "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog + chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz + echo " -> create copyright file" - touch "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" - cat > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" << EOM + touch "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright + cat > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright << EOM Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ${NAME} Upstream-Contact: Christina Sørensen @@ -121,14 +121,14 @@ License: MIT OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOM - chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" - + chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright + echo " -> build ${ARCH} package" dpkg-deb --build --root-owner-group "${DEB_TMP_DIR}" > /dev/null - + echo " -> cleanup" - rm -rf "${DEB_TMP_DIR}" "${ARCH}.tar.gz" "${NAME}" - + rm -rf "${DEB_TMP_DIR}" "${ARCH}".tar.gz ${NAME} + # gierens: this does not work on my arch at the moment and # i'm verifying on the repo host anyway thus the || true echo " -> lint ${ARCH} package" From e32331daaf27d3c17639e356d1d3c2f9e76f34dc Mon Sep 17 00:00:00 2001 From: Sandro-Alessio Gierens Date: Thu, 14 Sep 2023 08:32:15 +0200 Subject: [PATCH 19/38] style(devtools): fix shellcheck issues in deb-package.sh Signed-off-by: Sandro-Alessio Gierens --- devtools/deb-package.sh | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/devtools/deb-package.sh b/devtools/deb-package.sh index 3ac0efdfd..d67fef6f5 100755 --- a/devtools/deb-package.sh +++ b/devtools/deb-package.sh @@ -20,7 +20,7 @@ TARGETS["arm64"]="aarch64-unknown-linux-gnu" TARGETS["armhf"]="arm-unknown-linux-gnueabihf" echo "download release notes" -RELEASE_NOTES=$(curl -s ${REPO_URL}/releases/tag/"${TAG}") +RELEASE_NOTES=$(curl -s "${REPO_URL}/releases/tag/${TAG}") for ARCH in "${!TARGETS[@]}"; do echo "building ${ARCH} package:" @@ -41,28 +41,28 @@ for ARCH in "${!TARGETS[@]}"; do echo " -> creating directory structure" mkdir -p "${DEB_TMP_DIR}" - mkdir -p "${DEB_TMP_DIR}"${DESTDIR} - mkdir -p "${DEB_TMP_DIR}"${DOCDIR} - mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man1 - mkdir -p "${DEB_TMP_DIR}"${DOCDIR}/man5 - mkdir -p "${DEB_TMP_DIR}"/DEBIAN - mkdir -p "${DEB_TMP_DIR}"/usr/share/doc/${NAME} + mkdir -p "${DEB_TMP_DIR}${DESTDIR}" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man1" + mkdir -p "${DEB_TMP_DIR}${DOCDIR}/man5" + mkdir -p "${DEB_TMP_DIR}/DEBIAN" + mkdir -p "${DEB_TMP_DIR}/usr/share/doc/${NAME}" chmod 755 -R "${DEB_TMP_DIR}" - + echo " -> extract executable" tar -xzf "${ARCH}.tar.gz" - cp ${NAME} "${DEB_TMP_DIR}"${DESTDIR} - chmod 755 "${DEB_TMP_DIR}"${DESTDIR}/${NAME} + cp ${NAME} "${DEB_TMP_DIR}${DESTDIR}" + chmod 755 "${DEB_TMP_DIR}${DESTDIR}/${NAME}" echo " -> compress man pages" - gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}"${DOCDIR}man1/eza.1.gz - gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors.5.gz - gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}"${DOCDIR}man5/eza_colors-explanation.5.gz - chmod 644 "${DEB_TMP_DIR}"${DOCDIR}/**/*.gz - + gzip -cn9 target/man/eza.1 > "${DEB_TMP_DIR}${DOCDIR}man1/eza.1.gz" + gzip -cn9 target/man/eza_colors.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors.5.gz" + gzip -cn9 target/man/eza_colors-explanation.5 > "${DEB_TMP_DIR}${DOCDIR}man5/eza_colors-explanation.5.gz" + chmod 644 "${DEB_TMP_DIR}${DOCDIR}"/**/*.gz + echo " -> create control file" - touch "${DEB_TMP_DIR}"/DEBIAN/control - cat > "${DEB_TMP_DIR}"/DEBIAN/control < "${DEB_TMP_DIR}/DEBIAN/control" < copy changelog" - cp CHANGELOG.md "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog - gzip -cn9 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz - rm "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog - chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/changelog.gz - + cp CHANGELOG.md "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" + gzip -cn9 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" + rm "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog" + chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/changelog.gz" + echo " -> create copyright file" - touch "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright - cat > "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright << EOM + touch "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" + cat > "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" << EOM Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ${NAME} Upstream-Contact: Christina Sørensen @@ -121,14 +121,14 @@ License: MIT OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. EOM - chmod 644 "${DEB_TMP_DIR}"/usr/share/doc/${NAME}/copyright - + chmod 644 "${DEB_TMP_DIR}/usr/share/doc/${NAME}/copyright" + echo " -> build ${ARCH} package" dpkg-deb --build --root-owner-group "${DEB_TMP_DIR}" > /dev/null - + echo " -> cleanup" - rm -rf "${DEB_TMP_DIR}" "${ARCH}".tar.gz ${NAME} - + rm -rf "${DEB_TMP_DIR}" "${ARCH}.tar.gz" "${NAME}" + # gierens: this does not work on my arch at the moment and # i'm verifying on the repo host anyway thus the || true echo " -> lint ${ARCH} package" From 9b805033e13b63b8fe4610af3d769a44df49ae27 Mon Sep 17 00:00:00 2001 From: Martin Fillon Date: Thu, 14 Sep 2023 15:38:49 +0200 Subject: [PATCH 20/38] test(tests_unix): removed git test breaking on nix --- tests/cmd/long_git_header_unix.stderr | 0 tests/cmd/long_git_header_unix.stdout | 22 ---------------------- tests/cmd/long_git_header_unix.toml | 2 -- 3 files changed, 24 deletions(-) delete mode 100644 tests/cmd/long_git_header_unix.stderr delete mode 100644 tests/cmd/long_git_header_unix.stdout delete mode 100644 tests/cmd/long_git_header_unix.toml diff --git a/tests/cmd/long_git_header_unix.stderr b/tests/cmd/long_git_header_unix.stderr deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cmd/long_git_header_unix.stdout b/tests/cmd/long_git_header_unix.stdout deleted file mode 100644 index 32af50ed9..000000000 --- a/tests/cmd/long_git_header_unix.stdout +++ /dev/null @@ -1,22 +0,0 @@ -Git Name - -- a - -- b - -- c - -- d - -- e - -- exa - -- f - -- g - -- h - -- i - -- image.jpg.img.c.rs.log.png - -- index.svg - -- j - -- k - -- l - -- m - -- n - -- o - -- p - -- q - -- vagrant diff --git a/tests/cmd/long_git_header_unix.toml b/tests/cmd/long_git_header_unix.toml deleted file mode 100644 index 94f7a65a6..000000000 --- a/tests/cmd/long_git_header_unix.toml +++ /dev/null @@ -1,2 +0,0 @@ -bin.name = "eza" -args = "tests/itest --long --no-user --no-time --no-filesize --git --header --no-permissions" From e813644f5e8a025539c17362a97ad14a0e13d4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:21:00 +0200 Subject: [PATCH 21/38] refactor(debug): add tracing to various code parts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- src/fs/dir.rs | 1 + src/fs/file.rs | 2 ++ src/main.rs | 5 +++++ src/output/details.rs | 3 +++ 4 files changed, 11 insertions(+) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index f2d709319..8eddf7c66 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -42,6 +42,7 @@ impl Dir { .map(|result| result.map(|entry| entry.path())) .collect::>()?; + info!("Read directory succes {:?}", &path); Ok(Self { contents, path }) } diff --git a/src/fs/file.rs b/src/fs/file.rs index 9b27b265b..bb4ad1b11 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -204,6 +204,7 @@ impl<'dir> File<'dir> { /// Returns an IO error upon failure, but this shouldn’t be used to check /// if a `File` is a directory or not! For that, just use `is_directory()`. pub fn to_dir(&self) -> io::Result { + trace!("to_dir reading dir"); Dir::read_dir(self.path.clone()) } @@ -531,6 +532,7 @@ impl<'dir> File<'dir> { /// but as mentioned in the size function comment above, different filesystems /// make it difficult to get any info about a dir by it's size, so this may be it. fn is_empty_directory(&self) -> bool { + trace!("is_empty_directory reading dir"); match Dir::read_dir(self.path.clone()) { // . & .. are skipped, if the returned iterator has .next(), it's not empty Ok(has_files) => has_files.files(super::DotFilter::Dotfiles, None, false, false).next().is_none(), diff --git a/src/main.rs b/src/main.rs index c88e24314..f310395e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -118,8 +118,11 @@ fn main() { let theme = options.theme.to_theme(terminal_size::terminal_size().is_some()); let exa = Exa { options, writer, input_paths, theme, console_width, git }; + + info!("matching on exa.run"); match exa.run() { Ok(exit_status) => { + trace!("exa.run exit Ok(exit_status)"); exit(exit_status); } @@ -130,6 +133,7 @@ fn main() { Err(e) => { eprintln!("{e}"); + trace!("exa.run exit RUNTIME_ERROR"); exit(exits::RUNTIME_ERROR); } } @@ -225,6 +229,7 @@ impl<'args> Exa<'args> { Ok(f) => { if f.points_to_directory() && ! self.options.dir_action.treat_dirs_as_files() { + trace!("matching on to_dir"); match f.to_dir() { Ok(d) => dirs.push(d), Err(e) => writeln!(io::stderr(), "{file_path:?}: {e}")?, diff --git a/src/output/details.rs b/src/output/details.rs index d1cc45b6b..0fcfd0f39 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -68,6 +68,8 @@ use std::vec::IntoIter as VecIntoIter; use ansiterm::Style; use scoped_threadpool::Pool; +use log::*; + use crate::fs::{Dir, File}; use crate::fs::dir_action::RecurseOptions; use crate::fs::feature::git::GitCache; @@ -261,6 +263,7 @@ impl<'a> Render<'a> { let mut dir = None; if let Some(r) = self.recurse { if file.is_directory() && r.tree && ! r.is_too_deep(depth.0) { + trace!("matching on to_dir"); match file.to_dir() { Ok(d) => { dir = Some(d); From e68b3b45ef854697698304edb2867c56bea0b42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:22:01 +0200 Subject: [PATCH 22/38] refactor(main): make std::process::exit global MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f310395e0..b2b6de824 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,7 @@ use std::env; use std::ffi::{OsStr, OsString}; use std::io::{self, Write, ErrorKind}; use std::path::{Component, PathBuf}; +use std::process::exit; use ansiterm::{ANSIStrings, Style}; @@ -87,8 +88,6 @@ lazy_static! { } fn main() { - use std::process::exit; - #[cfg(unix)] unsafe { libc::signal(libc::SIGPIPE, libc::SIG_DFL); From 1ed2e1f84d1d4d25a36e5d4e4c85d85634691ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:22:36 +0200 Subject: [PATCH 23/38] feat(main): add PERMISSION_DENIED exit code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index b2b6de824..be679e6a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -382,4 +382,7 @@ mod exits { /// Exit code for when the command-line options are invalid. pub const OPTIONS_ERROR: i32 = 3; + + /// Exit code for when the you don't have permissions for the file. + pub const PERMISSION_DENIED: i32 = 13; } From 1054eb65689318b842184268b4d1f379acdbdf10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:23:02 +0200 Subject: [PATCH 24/38] fix(file): exit 13 on os error 13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #319 Signed-off-by: Christina Sørensen --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index be679e6a6..80bec3dea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -231,6 +231,10 @@ impl<'args> Exa<'args> { trace!("matching on to_dir"); match f.to_dir() { Ok(d) => dirs.push(d), + Err(e) if e.kind() == ErrorKind::PermissionDenied => { + warn!("Permission Denied: {e}"); + exit(exits::PERMISSION_DENIED); + }, Err(e) => writeln!(io::stderr(), "{file_path:?}: {e}")?, } } From 2f418970d9ae778fab80e9a17861767e791288a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:24:30 +0200 Subject: [PATCH 25/38] fix(main): rewrite comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Preston Thorpe Signed-off-by: Christina Sørensen --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 80bec3dea..bfd604f70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -387,6 +387,6 @@ mod exits { /// Exit code for when the command-line options are invalid. pub const OPTIONS_ERROR: i32 = 3; - /// Exit code for when the you don't have permissions for the file. + /// Exit code for missing file permissions pub const PERMISSION_DENIED: i32 = 13; } From 2ee6303ab9509d64ae7354d5bc9477296dd5df80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:28:34 +0200 Subject: [PATCH 26/38] fix(debug): improve trace strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MartinFillon <114775771+MartinFillon@users.noreply.github.com> Signed-off-by: Christina Sørensen --- src/fs/file.rs | 4 ++-- src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fs/file.rs b/src/fs/file.rs index bb4ad1b11..b33db54cf 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -204,7 +204,7 @@ impl<'dir> File<'dir> { /// Returns an IO error upon failure, but this shouldn’t be used to check /// if a `File` is a directory or not! For that, just use `is_directory()`. pub fn to_dir(&self) -> io::Result { - trace!("to_dir reading dir"); + trace!("to_dir: reading dir"); Dir::read_dir(self.path.clone()) } @@ -532,7 +532,7 @@ impl<'dir> File<'dir> { /// but as mentioned in the size function comment above, different filesystems /// make it difficult to get any info about a dir by it's size, so this may be it. fn is_empty_directory(&self) -> bool { - trace!("is_empty_directory reading dir"); + trace!("is_empty_directory: reading dir"); match Dir::read_dir(self.path.clone()) { // . & .. are skipped, if the returned iterator has .next(), it's not empty Ok(has_files) => has_files.files(super::DotFilter::Dotfiles, None, false, false).next().is_none(), diff --git a/src/main.rs b/src/main.rs index bfd604f70..f7ea06fc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,7 +121,7 @@ fn main() { info!("matching on exa.run"); match exa.run() { Ok(exit_status) => { - trace!("exa.run exit Ok(exit_status)"); + trace!("exa.run: exit Ok(exit_status)"); exit(exit_status); } @@ -132,7 +132,7 @@ fn main() { Err(e) => { eprintln!("{e}"); - trace!("exa.run exit RUNTIME_ERROR"); + trace!("exa.run: exit RUNTIME_ERROR"); exit(exits::RUNTIME_ERROR); } } From e7a50d33fd341a399c635a31cd588a2baff661f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 16:29:29 +0200 Subject: [PATCH 27/38] fix(debug): tracing typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christina Sørensen Signed-off-by: Christina Sørensen --- src/fs/dir.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs/dir.rs b/src/fs/dir.rs index 8eddf7c66..4b1de8cc5 100644 --- a/src/fs/dir.rs +++ b/src/fs/dir.rs @@ -42,7 +42,7 @@ impl Dir { .map(|result| result.map(|entry| entry.path())) .collect::>()?; - info!("Read directory succes {:?}", &path); + info!("Read directory success {:?}", &path); Ok(Self { contents, path }) } From 4edb78a0877c074ac0e8713086b478bde466b213 Mon Sep 17 00:00:00 2001 From: Martin Fillon Date: Thu, 14 Sep 2023 16:39:30 +0200 Subject: [PATCH 28/38] docs: Added instructions to install completions of eza to the readme --- README.md | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index d1ae4fff0..bdad1fb67 100644 --- a/README.md +++ b/README.md @@ -27,20 +27,20 @@ And it’s **small**, **fast**, and just **one single binary**. By deliberately making some decisions differently, eza attempts to be a more featureful, more user-friendly version of `ls`. - --- **eza** features not in exa (non-exhaustive): - - Fixes [“The Grid Bug”](https://github.com/eza-community/eza/issues/66#issuecomment-1656758327) introduced in exa 2021. - - Hyperlink support. - - Mount point details. - - Selinux context output. - - Git repo status output. - - Human readable relative dates. - - Several security fixes. - - Many smaller bug fixes/changes! - - Support for `bright` terminal colours. +- Fixes [“The Grid Bug”](https://github.com/eza-community/eza/issues/66#issuecomment-1656758327) introduced in exa 2021. +- Hyperlink support. +- Mount point details. +- Selinux context output. +- Git repo status output. +- Human readable relative dates. +- Several security fixes. +- Many smaller bug fixes/changes! +- Support for `bright` terminal colours. + --- @@ -53,7 +53,7 @@ If you already have Nix setup with flake support, you can try out eza with the ` nix run github:eza-community/eza -Nix will build eza and run it. +Nix will build eza and run it. If you want to pass arguments this way, use e.g. `nix run github:eza-community/eza -- -ol`. @@ -99,6 +99,7 @@ Eza is available from [deb.gierens.de](http://deb.gierens.de). The GPG public key is in this repo under [deb.asc](/deb.asc). To install eza from this repo use: + ```bash wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo tee /etc/apt/trusted.gpg.d/gierens.asc echo "deb http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list @@ -108,9 +109,11 @@ sudo apt install -y eza **Note:** on some systems like Docker containers apt might require the key to be in dearmored format, then use this command instead: + ```bash wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/gierens.asc ``` + before proceeding with the others from above. ### Nix (Linux, MacOS) @@ -175,7 +178,6 @@ The preceding repository also contains the Bash, Fish, and Zsh completions. [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/eza.svg)](https://repology.org/project/eza/versions) - Eza is available from [Homebrew](https://formulae.brew.sh/formula/eza#default). To install eza, run: @@ -200,7 +202,6 @@ sudo port install eza [![Windows package](https://repology.org/badge/version-for-repo/scoop/eza.svg)](https://repology.org/project/eza/versions) - Eza is available from [Scoop](https://scoop.sh/#/apps?q=eza&id=a52070d25f94bbcc884f80bef53eb47ed1268198). To install eza, run: @@ -209,7 +210,17 @@ To install eza, run: scoop install eza ``` +## Install Compeltions (manually) + +zsh: + +```sh +git clone https://github.com/eza-community/eza.git +echo 'export FPATH="/completions/zsh:$FPATH" >> ~/.zshrc +``` + --- + Click sections to expand. @@ -313,22 +324,22 @@ Once Rust is installed, you can compile eza with Cargo: cargo test - The [just](https://github.com/casey/just) command runner can be used to run some helpful development commands, in a manner similar to `make`. -Run `just --list` to get an overview of what’s available. + Run `just --list` to get an overview of what’s available. - If you are compiling a copy for yourself, be sure to run `cargo build --release` or `just build-release` to benefit from release-mode optimisations. -Copy the resulting binary, which will be in the `target/release` directory, into a folder in your `$PATH`. -`/usr/local/bin` is usually a good choice. + Copy the resulting binary, which will be in the `target/release` directory, into a folder in your `$PATH`. + `/usr/local/bin` is usually a good choice. - To compile and install the manual pages, you will need [pandoc](https://pandoc.org/). -The `just man` command will compile the Markdown into manual pages, which it will place in the `target/man` directory. -To use them, copy them into a directory that `man` will read. -`/usr/local/share/man` is usually a good choice. + The `just man` command will compile the Markdown into manual pages, which it will place in the `target/man` directory. + To use them, copy them into a directory that `man` will read. + `/usr/local/share/man` is usually a good choice. - eza depends on [libgit2](https://github.com/rust-lang/git2-rs) for certain features. -If you’re unable to compile libgit2, you can opt out of Git support by running `cargo build --no-default-features`. + If you’re unable to compile libgit2, you can opt out of Git support by running `cargo build --no-default-features`. - If you intend to compile for musl, you will need to use the flag `vendored-openssl` if you want to get the Git feature working. -The full command is `cargo build --release --target=x86_64-unknown-linux-musl --features vendored-openssl,git`. + The full command is `cargo build --release --target=x86_64-unknown-linux-musl --features vendored-openssl,git`. ### Developing on Nix (experimental) ❄️ @@ -337,12 +348,12 @@ If you have a working Nix installation with flake support, you can use nix to ma nix develop The Nix Flake has a few features: + - Run `nix flake check` to run `treefmt` on the repo. - Run `nix build` and manually test `./results/bin/eza -- ` for easy debugging. - Run `nix build .#test` to run `cargo test` via the flake. - Run `nix build .#clippy` to lint with clippy (still work in progress). - ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=eza-community/eza&type=Date)](https://star-history.com/#eza-community/eza&Date) From 08b92a06c57289b3e16320ee5301b897fb660ac3 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Thu, 14 Sep 2023 11:00:57 -0400 Subject: [PATCH 29/38] docs: remove color specifications. change unknown git repo status to `~` --- man/eza.1.md | 2 +- src/output/render/git.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/eza.1.md b/man/eza.1.md index 343051396..d2d61e72b 100644 --- a/man/eza.1.md +++ b/man/eza.1.md @@ -201,7 +201,7 @@ This adds a two-character column indicating the staged and unstaged statuses res `--git-repos` [if eza was built with git support] : List each directory’s Git status, if tracked. -Symbols shown are `|` (green) for clean, `+` (red) for dirty, and `-`(green) for unknown. +Symbols shown are `|`= clean, `+`= dirty, and `~`= for unknown. `--git-repos-no-status` [if eza was built with git support] : List if a directory is a Git repository, but not its status. diff --git a/src/output/render/git.rs b/src/output/render/git.rs index 603f608c6..34befa6bf 100644 --- a/src/output/render/git.rs +++ b/src/output/render/git.rs @@ -32,7 +32,7 @@ impl f::SubdirGitRepo { f::SubdirGitRepoStatus::NoRepo => style.paint("- "), f::SubdirGitRepoStatus::GitClean => style.fg(Color::Green).paint("| "), f::SubdirGitRepoStatus::GitDirty => style.bold().fg(Color::Red).paint("+ "), - f::SubdirGitRepoStatus::GitUnknown => style.fg(Color::Green).bold().paint("- "), + f::SubdirGitRepoStatus::GitUnknown => style.fg(Color::Green).bold().paint("~ "), }; TextCell { From 3f1e5ef4eac431339bad34b8e007590de1775f94 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Thu, 14 Sep 2023 11:02:30 -0400 Subject: [PATCH 30/38] docs: fix missing color specification from man page --- man/eza.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/eza.1.md b/man/eza.1.md index d2d61e72b..abf758953 100644 --- a/man/eza.1.md +++ b/man/eza.1.md @@ -205,7 +205,7 @@ Symbols shown are `|`= clean, `+`= dirty, and `~`= for unknown. `--git-repos-no-status` [if eza was built with git support] : List if a directory is a Git repository, but not its status. -All Git repository directories will be shown as `-` (green) without status indicated. +All Git repository directories will be shown as (themed) `-` without status indicated. `--no-git` From fc5096011488b1c6e882c6aba12d9bcfb205cec3 Mon Sep 17 00:00:00 2001 From: Coco Liliace Date: Thu, 14 Sep 2023 23:58:37 +0800 Subject: [PATCH 31/38] docs: add missing man page for debian release --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index b55e343bf..cf6e9899c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ assets = [ [ "target/release/eza", "/usr/bin/eza", "0755" ], [ "target/release/../man/eza.1", "/usr/share/man/man1/eza.1", "0644" ], [ "target/release/../man/eza_colors.5", "/usr/share/man/man5/eza_colors.5", "0644" ], + [ "target/release/../man/eza_colors-explanation.5", "/usr/share/man/man5/eza_colors-explanation.5", "0644" ], [ "completions/bash/eza", "/usr/share/bash-completion/completions/eza", "0644" ], [ "completions/zsh/_eza", "/usr/share/zsh/site-functions/_eza", "0644" ], [ "completions/fish/eza.fish", "/usr/share/fish/vendor_completions.d/eza.fish", "0644" ], From 27d96dd2de860b647f828e9e65f7cc7038bdf8e7 Mon Sep 17 00:00:00 2001 From: MartinFillon Date: Thu, 14 Sep 2023 18:56:56 +0200 Subject: [PATCH 32/38] chore(test_generator): run spellcheck --- devtools/generate-trycmd-test.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/devtools/generate-trycmd-test.sh b/devtools/generate-trycmd-test.sh index 7097ac807..a3386905b 100755 --- a/devtools/generate-trycmd-test.sh +++ b/devtools/generate-trycmd-test.sh @@ -9,32 +9,32 @@ fi # Clean up previous test data -if [ -f tests/cmd/$1.toml ]; then - rm tests/cmd/$1.toml +if [ -f tests/cmd/"$1".toml ]; then + rm tests/cmd/"$1".toml fi -if [ -f tests/cmd/$1.stdout ]; then - rm tests/cmd/$1.stdout +if [ -f tests/cmd/"$1".stdout ]; then + rm tests/cmd/"$1".stdout fi -if [ -f tests/cmd/$1.stderr ]; then - rm tests/cmd/$1.stderr +if [ -f tests/cmd/"$1".stderr ]; then + rm tests/cmd/"$1".stderr fi # Generate test data -touch tests/cmd/$1.toml +touch tests/cmd/"$1".toml -echo 'bin.name = "eza"' >> tests/cmd/$1.toml -echo 'args = "'$2'"' >> tests/cmd/$1.toml +echo 'bin.name = "eza"' >> tests/cmd/"$1".toml +echo 'args = "'"$2"'"' >> tests/cmd/"$1".toml # Generate expected output if [ -f target/debug/eza ]; then - target/debug/eza $2 > tests/cmd/$1.stdout 2> tests/cmd/$1.stderr + target/debug/eza "$2" > tests/cmd/"$1".stdout 2> tests/cmd/"$1".stderr returncode=$? if [ $returncode -ne 0 ]; then - echo -e 'status.code = '$returncode'' >> tests/cmd/$1.toml + echo -e 'status.code = '$returncode'' >> tests/cmd/"$1".toml exit 0 fi else From 2e028fb4a5daf976028ad4aad5990f25bede0c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 19:30:02 +0200 Subject: [PATCH 33/38] chore: release 0.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- CHANGELOG.md | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 145 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c8b77af..a26ba3f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,146 @@ All notable changes to this project will be documented in this file. +## [0.12.0] - 2023-09-14 + +### Bug Fixes + +- Expand `--all` help +- RUSTSEC-2020-0071 +- Generalize gitignore to ignore all eza deb packages +- Canonicalize errors when the destination of a symbolic link is bad +- Handle other canonicalize errors in hyperlinks and git +- Fix windows build when canonicalize returns an error +- Change trycmd config to use test/itest folder for testing +- Revert to old apt install command suggestion and add hint +- Remove stray backslashes +- Is_some_and is an unstable Rust feature until 1.70 +- Revert "Support for Windows Hidden Files" +- Shellcheck warnings +- Revert "Support for Windows Hidden Files" +- Shellcheck warnings +- Exit 13 on os error 13 +- Rewrite comment +- Improve trace strings +- Tracing typo + +### Documentation + +- Expand `--all` documentation +- Add pthorpe92 gist +- Remove xtests section from readme +- Add deprecation warning to xtests/readme +- Add deprecation warning to just xtest commands +- Add deprecation warning to vagrantfile +- Add MacPorts install info +- Add gentoo +- Fix gentoo install +- Add docs for --git-repos & --git-repos-no-status +- Fix gpg armor flag for deb release in readme +- Add better explanation of git repos + no status +- Add scoop install info +- Remove color specifications. change unknown git repo status to `~` +- Fix missing color specification from man page + +### Features + +- Add audit workflow +- Add trycmd as dev-dependency +- Add minimal trycmd binary +- Add a few trycmd tests as example +- Document and change output for --git-repos +- Add apt installation workflow +- Adds filtering on Windows hidden files +- Adds filtering on Windows hidden files +- Adds filtering on Windows hidden files +- Added shellcheck to treefmt +- Adds filtering on Windows hidden files +- Add PERMISSION_DENIED exit code + +### Miscellaneous Tasks + +- Bump chrono from 0.4.27 to 0.4.30 +- Removal of xtests +- Removal of vagrant +- Remove deprecated devtools +- Run spellcheck + +### Refactor + +- Over-engineer deb-package.sh +- Hide xtests folder +- Split trycmd into tests for all, unix and windows +- Limit unit-tests run on workflow change to unit-tests itself +- Moved generateTest.sh to devtools/ +- Renamed the file +- Add tracing to various code parts +- Make std::process::exit global + +### Revert + +- "Support for Windows Hidden Files" + +### Styling + +- Remove TODO message on the absolute_path property +- Fix shellcheck issues in deb-package.sh +- Fix shellcheck issues in deb-package.sh +- Fix shellcheck issues in deb-package.sh + +### Testing + +- Remove vhs from flake +- Remove vhs-runner files +- Dump trycmd from nix sandbox +- Fix name of trydump +- Add trycmd +- Add nix feature +- Add example long tests for sandbox +- Set itests files to unix epoch +- Set itest files to unix epoch +- Refactor setting unix epoch +- Auto discard old definitions +- Fix test reference +- Add long_all_nix.toml +- Add long_blocksize_nix.toml +- Add long_extended_nix.toml +- Add long_git_nix.toml +- Add long_git_repos_nix.toml +- Add long_git_repos_no_status_nix.toml +- Add long_grid_nix.toml +- Add long_header_nix.toml +- Add long_icons_nix.toml +- Add long_octal_nix.toml +- Add long_time_style_relative_nix.toml +- Freeze nix tests +- Fix trydump when no files to delete +- Adding more content to test +- Modified unix and all tests +- Regenerate nix tests +- Convert windows tests with new itest dir +- Fixed windows tests being wrong +- Added a test generator +- Add more unix_tests +- Fixed unix tests to remove any distro specific +- Removed git test breaking on nix + +### Build + +- Add compression, checksum gen for bin +- Update flake.lock, cargo.lock +- Add deny.toml +- Remove org warnings +- Remove itest +- Update flake.lock +- Add itest, idump +- Make trycmd part of checks + +### Ci + +- Don't use nix feature on ci +- Enforce conventional commits +- Enforce conventional commits + ## [0.11.1] - 2023-09-11 ### Bug Fixes @@ -37,6 +177,8 @@ All notable changes to this project will be documented in this file. ### Miscellaneous Tasks - Bump actions/checkout from 3 to 4 +- Bump uzers to v0.11.3 +- Release 0.11.1 ### Testing @@ -174,6 +316,7 @@ All notable changes to this project will be documented in this file. - Cafkafk -> eza-community - Add gpg public key for the deb repository - Add section about debian and ubuntu installation +- Add guidelines for commit messages ### Features diff --git a/Cargo.lock b/Cargo.lock index 0acd56568..df3979508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "eza" -version = "0.11.1" +version = "0.12.0" dependencies = [ "ansiterm", "chrono", diff --git a/Cargo.toml b/Cargo.toml index b55e343bf..2c79745a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" homepage = "https://github.com/eza-community/eza" license = "MIT" repository = "https://github.com/eza-community/eza" -version = "0.11.1" +version = "0.12.0" [package.metadata.deb] From 2aa0f8f0dcc7fdabd824d93dfe9537e4fe2c0eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 19:37:30 +0200 Subject: [PATCH 34/38] test(trycmd): remove non-deterministic test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- tests/cmd/long_links_recurse_unix.stderr | 0 tests/cmd/long_links_recurse_unix.stdout | 47 ------------------------ 2 files changed, 47 deletions(-) delete mode 100644 tests/cmd/long_links_recurse_unix.stderr delete mode 100644 tests/cmd/long_links_recurse_unix.stdout diff --git a/tests/cmd/long_links_recurse_unix.stderr b/tests/cmd/long_links_recurse_unix.stderr deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/cmd/long_links_recurse_unix.stdout b/tests/cmd/long_links_recurse_unix.stdout deleted file mode 100644 index 4d41d1a1a..000000000 --- a/tests/cmd/long_links_recurse_unix.stdout +++ /dev/null @@ -1,47 +0,0 @@ -1 a -1 b -1 c -1 d -1 e -3 exa -1 f -1 g -1 h -1 i -1 image.jpg.img.c.rs.log.png -1 index.svg -1 j -1 k -1 l -1 m -1 n -1 o -1 p -1 q -5 vagrant - -tests/itest/exa: -1 file.c -> djihisudjuhfius -2 sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss - -tests/itest/exa/sssssssssssssssssssssssssggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss: -1 Makefile - -tests/itest/vagrant: -2 debug -2 dev -3 log - -tests/itest/vagrant/debug: -1 symlinking -> a - -tests/itest/vagrant/dev: -1 main.bf - -tests/itest/vagrant/log: -1 file.png -2 run - -tests/itest/vagrant/log/run: -1 run.log.text -1 sps.log.text From b35bcf113e2f2c646b6e0c0af67467b14e34153c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 19:51:42 +0200 Subject: [PATCH 35/38] fix(crates.io): crate can't contain broken symlink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2c79745a0..7626f3fe9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Christina Sørensen "] categories = ["command-line-utilities"] edition = "2021" rust-version = "1.65.0" -exclude = ["/devtools/*", "/Justfile", "/Vagrantfile", "/screenshots.png"] +exclude = ["/devtools/*", "/Justfile", "/Vagrantfile", "/screenshots.png", "/tests"] readme = "README.md" homepage = "https://github.com/eza-community/eza" license = "MIT" From 74f0f17211772cb6bc4240d433c90cd22c1300bd Mon Sep 17 00:00:00 2001 From: MartinFillon <114775771+MartinFillon@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:55:19 +0200 Subject: [PATCH 36/38] docs(readme): added cafkafk suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christina Sørensen Signed-off-by: MartinFillon <114775771+MartinFillon@users.noreply.github.com> --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bdad1fb67..783f83b08 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ By deliberately making some decisions differently, eza attempts to be a more fea - Git repo status output. - Human readable relative dates. - Several security fixes. -- Many smaller bug fixes/changes! - Support for `bright` terminal colours. +- Many smaller bug fixes/changes! --- @@ -210,15 +210,30 @@ To install eza, run: scoop install eza ``` -## Install Compeltions (manually) +### For zsh: -zsh: +> **Note** +> Change `~/.zshrc` to your preferred zsh config file. +**Clone the repository**: + ```sh git clone https://github.com/eza-community/eza.git -echo 'export FPATH="/completions/zsh:$FPATH" >> ~/.zshrc -``` +\``` + +**Add the completion path to your zsh configuration**: + +Replace `` with the actual path where you cloned the `eza` repository. +```sh +echo 'export FPATH="/completions/zsh:$FPATH"' >> ~/.zshrc +\``` + +**Reload your zsh configuration**: + +```sh +source ~/.zshrc +\``` --- Click sections to expand. From 570bbbb7c937ccd1cb5dd0241526611cd36cb00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 21:08:43 +0200 Subject: [PATCH 37/38] docs(readme): fix codeblocks in zsh completions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 783f83b08..ec66ab71e 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ scoop install eza ```sh git clone https://github.com/eza-community/eza.git -\``` +``` **Add the completion path to your zsh configuration**: @@ -227,13 +227,14 @@ Replace `` with the actual path where you cloned the `eza` reposito ```sh echo 'export FPATH="/completions/zsh:$FPATH"' >> ~/.zshrc -\``` +``` **Reload your zsh configuration**: ```sh source ~/.zshrc -\``` +``` + --- Click sections to expand. From 36f9f5b02fe3dfa51fcb0be3800868b5fe6e3332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 14 Sep 2023 19:11:45 +0000 Subject: [PATCH 38/38] docs: Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec66ab71e..20632144a 100644 --- a/README.md +++ b/README.md @@ -210,18 +210,20 @@ To install eza, run: scoop install eza ``` -### For zsh: +### Completions + +#### For zsh: > **Note** > Change `~/.zshrc` to your preferred zsh config file. -**Clone the repository**: +##### Clone the repository: ```sh git clone https://github.com/eza-community/eza.git ``` -**Add the completion path to your zsh configuration**: +##### Add the completion path to your zsh configuration: Replace `` with the actual path where you cloned the `eza` repository. @@ -229,7 +231,7 @@ Replace `` with the actual path where you cloned the `eza` reposito echo 'export FPATH="/completions/zsh:$FPATH"' >> ~/.zshrc ``` -**Reload your zsh configuration**: +##### Reload your zsh configuration: ```sh source ~/.zshrc