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

github.com/torch/paths.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua.in')
-rw-r--r--init.lua.in15
1 files changed, 12 insertions, 3 deletions
diff --git a/init.lua.in b/init.lua.in
index 684dba9..515437f 100644
--- a/init.lua.in
+++ b/init.lua.in
@@ -44,10 +44,19 @@ install_lua_cpath = concat(install_prefix, install_lua_cpath_subdir)
assert(concat(install_bin,install_bin_ridbus) == install_prefix:gsub('/$',''))
assert(concat(install_cmake,install_cmake_ridbus) == install_prefix:gsub('/$',''))
-if dirp("C:\\") == false then
- home = os.getenv('HOME') or '.'
+function is_win()
+ return uname():match('Windows')
+end
+
+function is_mac()
+ return uname():match('Darwin')
+end
+
+if is_win() then
+ home = os.getenv('HOMEDRIVE') or 'C:'
+ home = home .. ( os.getenv('HOMEPATH') or '\\' )
else
- home = ( os.getenv('HOMEDRIVE') or 'C:' ) .. ( os.getenv('HOMEPATH') or '\\' )
+ home = os.getenv('HOME') or '.'
end
function files(s)