File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Symfony/Component/Finder/Adapter Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public function searchInDirectory($dir)
84
84
$ this ->buildDatesFiltering ($ find , $ this ->dates );
85
85
86
86
$ useGrep = $ this ->shell ->testCommand ('grep ' ) && $ this ->shell ->testCommand ('xargs ' );
87
- $ useSort = is_int ($ this ->sort ) && $ this ->shell ->testCommand ('sort ' ) && $ this ->shell ->testCommand ('awk ' );
87
+ $ useSort = is_int ($ this ->sort ) && $ this ->shell ->testCommand ('sort ' ) && $ this ->shell ->testCommand ('cut ' );
88
88
89
89
if ($ useGrep && ($ this ->contains || $ this ->notContains )) {
90
90
$ grep = $ command ->ins ('grep ' );
@@ -286,8 +286,8 @@ private function buildSorting(Command $command, $sort)
286
286
{
287
287
switch ($ sort ) {
288
288
case SortableIterator::SORT_BY_NAME :
289
- $ format = null ;
290
- break ;
289
+ $ command -> ins ( ' sort ' )-> add ( ' | sort ' ) ;
290
+ return ;
291
291
case SortableIterator::SORT_BY_TYPE :
292
292
$ format = '%y ' ;
293
293
break ;
@@ -306,6 +306,6 @@ private function buildSorting(Command $command, $sort)
306
306
307
307
$ command ->get ('find ' )->add ('-printf ' )->arg ($ format .' %h/%f \\n ' );
308
308
$ command ->ins ('sort ' )->add ('| sort ' );
309
- $ command ->ins ('awk ' )->add ('| awk ' )->arg ('{ print $ ' .( null === $ format ? ' 1 ' : ' 2 ' ). ' } ' );
309
+ $ command ->ins ('awk ' )->add ('| cut ' )->arg ('-d ' )-> arg ( ' -f2- ' );
310
310
}
311
311
}
You can’t perform that action at this time.
0 commit comments