Skip to content

Commit 07b04dd

Browse files
committed
Fix the error with ls on macOS
Replace ls --sort=time with ls -t
1 parent 772f2cc commit 07b04dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mdt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ file_editor="${MDT_EDITOR:-${EDITOR}}"
1515
################################################
1616

1717
me="${0##*/}"
18-
mdt_version="1.2.0"
18+
mdt_version="1.2.1"
1919

2020
print_help()
2121
{
@@ -96,11 +96,11 @@ get_file_with_checkboxes() {
9696
_checkbox_pattern="^[[:space:]]*- \[${_checkbox_type}\]"
9797

9898
if [ "${isPWD}" ]; then
99-
_files="$(ls -1 --sort=time -- *.md | tr "\n" "\0" \
99+
_files="$(ls -1 -t -- *.md | tr "\n" "\0" \
100100
| xargs -0 grep -l "${_checkbox_pattern}")"
101101
else
102102
_files="$(find * -name '*.md' -not -path '*/.*' \
103-
-exec ls -1 --sort=time {} + | tr "\n" "\0" \
103+
-exec ls -1 -t -- {} + | tr "\n" "\0" \
104104
| xargs -0 grep -l "${_checkbox_pattern}")"
105105
fi
106106

0 commit comments

Comments
 (0)