File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -164,13 +164,15 @@ processTasks = function processTasks(tasks) {
164164/**
165165 * used to sort ordering of task files based on desire.
166166 *
167- * @param {string } a - string representing task filename
168- * @param {string } b - string representing task filename
167+ * @param {string } a - string representing task filepath
168+ * @param {string } b - string representing task filepath
169169 * @returns {bool } - used by Array.sort
170170*/
171171sortFiles = function sortFiles ( a , b ) {
172- var aIndex = rc . order . indexOf ( a ) ,
173- bIndex = rc . order . indexOf ( b ) ;
172+ var taskA = a . substring ( a . lastIndexOf ( '/' ) + 1 ) ,
173+ taskB = b . substring ( b . lastIndexOf ( '/' ) + 1 ) ,
174+ aIndex = rc . order . indexOf ( taskA ) ,
175+ bIndex = rc . order . indexOf ( taskB ) ;
174176 if ( bIndex !== - 1 && aIndex !== - 1 && aIndex < bIndex ) return - 1 ;
175177 if ( aIndex !== - 1 || bIndex !== - 1 ) return 1 ;
176178} ,
Original file line number Diff line number Diff line change 11{
22 "name" : " kody" ,
33 "description" : " .files in node" ,
4- "version" : " 1.0 .1" ,
4+ "version" : " 1.1 .1" ,
55 "main" : " index.js" ,
66 "homepage" : " https://github.com/jh3y/kody" ,
77 "author" : {
Original file line number Diff line number Diff line change @@ -98,13 +98,15 @@ const PROPS = {
9898 /**
9999 * used to sort ordering of task files based on desire.
100100 *
101- * @param {string } a - string representing task filename
102- * @param {string } b - string representing task filename
101+ * @param {string } a - string representing task filepath
102+ * @param {string } b - string representing task filepath
103103 * @returns {bool } - used by Array.sort
104104 */
105105 sortFiles = function ( a , b ) {
106- const aIndex = rc . order . indexOf ( a ) ,
107- bIndex = rc . order . indexOf ( b ) ;
106+ const taskA = a . substring ( a . lastIndexOf ( '/' ) + 1 ) ,
107+ taskB = b . substring ( b . lastIndexOf ( '/' ) + 1 ) ,
108+ aIndex = rc . order . indexOf ( taskA ) ,
109+ bIndex = rc . order . indexOf ( taskB ) ;
108110 if ( bIndex !== - 1 && aIndex !== - 1 && aIndex < bIndex )
109111 return - 1 ;
110112 if ( aIndex !== - 1 || bIndex !== - 1 )
You can’t perform that action at this time.
0 commit comments