File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ search_filenames_and_contents() {
62
62
find_output=$( find " $notes_dir " -type f)
63
63
fi
64
64
find_result=$?
65
- formatted_output=$( printf " $find_output " | without_notes_dir)
65
+ formatted_output=$( printf " $find_output " | without_notes_dir | sort )
66
66
67
67
if [[ $find_result == 0 && " $formatted_output " ]]; then
68
68
printf " $formatted_output \n"
@@ -75,7 +75,7 @@ search_filenames_and_contents() {
75
75
find_notes () {
76
76
local find_output=$( find " $notes_dir " -ipath " $notes_dir /*$* *" -type f 2>&1 )
77
77
local find_result=$?
78
- local formatted_output=$( printf " $find_output " | without_notes_dir)
78
+ local formatted_output=$( printf " $find_output " | without_notes_dir | sort )
79
79
80
80
if [[ $find_result == 0 && " $formatted_output " ]]; then
81
81
printf " $formatted_output \n"
@@ -93,7 +93,7 @@ grep_notes() {
93
93
94
94
local grep_output=$( grep -r " $notes_dir " -li -e " $* " 2>&1 )
95
95
local grep_result=$?
96
- local formatted_output=$( printf " $grep_output " | without_notes_dir)
96
+ local formatted_output=$( printf " $grep_output " | without_notes_dir | sort )
97
97
98
98
if [[ $grep_result == 0 && " $formatted_output " ]]; then
99
99
printf " $formatted_output \n"
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ notes="./notes"
56
56
}
57
57
58
58
@test " Show multiple files passed by pipe from find" {
59
- echo line1 >> " $NOTES_DIRECTORY /note .md"
59
+ echo line1 >> " $NOTES_DIRECTORY /note1 .md"
60
60
echo line2 >> " $NOTES_DIRECTORY /note2.md"
61
61
62
62
run bash -c " $notes find | $notes cat"
You can’t perform that action at this time.
0 commit comments