[seed] Change the default search order of searchPath



commit edb3288b0c7359644342ab0f10cfa69c53f6b117
Author: Alan Knowles <alan akbkhome com>
Date:   Fri Jun 18 19:06:15 2010 +0800

    Change the default search order of searchPath
    
    - First place looked is the same directory as __script_path__
    - Second is the initial __script_path__ of the application
    - Lastly, looks in all other locations. (eg. modules/ library paths etc.)
    * removes looking in current working directory (was previous behaviour)

 extensions/Seed.js.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/Seed.js.in b/extensions/Seed.js.in
index 947a7e5..9acb189 100644
--- a/extensions/Seed.js.in
+++ b/extensions/Seed.js.in
@@ -196,7 +196,7 @@ if(!imports.searchPath || (imports.searchPath.length == 0))
 			__script_path__ = imports.os.realpath(__script_path__);
 		
 			if(__script_path__ && __script_path__ != "")
-				imports.searchPath.push(__script_path__);
+				imports.searchPath.unshift(__script_path__);
 		}
 		catch(e)
 		{
@@ -204,5 +204,5 @@ if(!imports.searchPath || (imports.searchPath.length == 0))
 		}
 	}
 
-	imports.searchPath.push(".");
+	imports.searchPath.unshift(".");
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]