Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/env.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fidjeland <andreas@fidjeland.io>2014-02-24 18:50:28 +0400
committerAndreas Fidjeland <andreas@fidjeland.io>2014-02-24 18:50:28 +0400
commit23608098586e8ccfc0292df382ff797b39c1990e (patch)
tree8cde9294ac3d6518ed45fcef6628f66ebd2e517e
parent459ec7c8ec749fd1b744aac7a3a643a34389d370 (diff)
Changed the path and cpath order
This undoes manipulation of the path/cpath performed by dok at require-time.
-rw-r--r--init.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 419e291..a0acb6d 100644
--- a/init.lua
+++ b/init.lua
@@ -280,6 +280,8 @@ if paths.dirp(localinstalldir) then
package.cpath = paths.concat(localinstalldir,'lib','lua','5.1','?.dylib') .. ';' .. package.cpath
end
+local origpath = package.path
+local origcpath = package.cpath
function loaddefaultlibs(loadwithimport)
if loadwithimport == nil then loadwithimport = false end
@@ -298,6 +300,10 @@ end
local loadwithimport = false
loaddefaultlibs(loadwithimport)
+-- undo path manipulation performed by dok
+package.path = origpath
+package.cpath = origcpath
+
_G._preloaded_ = {}
for k,v in pairs(_G) do
_G._preloaded_[k] = true