diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 17:17:03 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 17:17:16 -0700 |
| commit | bf224aacf2be9fc316fc08fdfc17a5bab0530767 (patch) | |
| tree | 4a4056853f6c7c68cf6e95eaa4aab57df9cac498 | |
| parent | b1c0446a3c65e8e22a9ecfd9d24213a2b9eac22b (diff) | |
Updated luafilesystem urls to point to both JIT and non-JIT versions.
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | files.lua | 8 | ||||
| -rw-r--r-- | files.moon | 5 |
3 files changed, 12 insertions, 3 deletions
@@ -6,7 +6,7 @@ revolving around natural language rule-making and self modification. ## Dependencies -Nomsu's only dependencies are [Lua 5.2 or later](https://www.lua.org/) or [Luajit 2.0 or later](http://luajit.org/) and [LPEG](http://www.inf.puc-rio.br/~roberto/lpeg/) (`luarocks install lpeg`). Nomsu's compiler was written in [Moonscript](http://moonscript.org/), but all of the .moon files have been compiled into lua for convenience, so Moonscript is not a dependency. Optionally, if [luafilesystem](https://github.com/spacewander/luafilesystem) is installed, it will be used. Otherwise Nomsu will fall back to using system commands (`find` and `ls`), which is slower and a bit less safe. Nomsu has been tested on Mac and Linux, but not Windows. +Nomsu's only dependencies are [Lua 5.2 or later](https://www.lua.org/) or [Luajit 2.0 or later](http://luajit.org/) and [LPEG](http://www.inf.puc-rio.br/~roberto/lpeg/) (`luarocks install lpeg`). Nomsu's compiler was written in [Moonscript](http://moonscript.org/), but all of the .moon files have been compiled into lua for convenience, so Moonscript is not a dependency. Optionally, if luafilesystem ([Lua version](https://github.com/keplerproject/luafilesystem) or [LuaJIT version](https://github.com/spacewander/luafilesystem)) is installed, it will be used. Otherwise Nomsu will fall back to using system commands (`find` and `ls`), which is slower and a bit less safe. Nomsu has been tested on Mac and Linux, but not Windows. ## Usage @@ -157,7 +157,13 @@ if ok then end else if not (run_cmd('find . -maxdepth 0')) then - error("Could not find 'luafilesystem' module and couldn't run system command `find` (this might happen on Windows). Please install `luafilesystem` (which can be found at: http://keplerproject.github.io/luafilesystem/ or `luarocks install luafilesystem`)", 0) + local url + if jit then + url = 'https://github.com/spacewander/luafilesystem' + else + url = 'https://github.com/keplerproject/luafilesystem' + end + error("Could not find 'luafilesystem' module and couldn't run system command `find` (this might happen on Windows). Please install `luafilesystem` (which can be found at: " .. tostring(url) .. " or `luarocks install luafilesystem`)", 0) end end Files.walk = function(path, flush_cache) @@ -92,7 +92,10 @@ if ok return _BROWSE_CACHE[filename] else unless run_cmd('find . -maxdepth 0') - error "Could not find 'luafilesystem' module and couldn't run system command `find` (this might happen on Windows). Please install `luafilesystem` (which can be found at: http://keplerproject.github.io/luafilesystem/ or `luarocks install luafilesystem`)", 0 + url = if jit + 'https://github.com/spacewander/luafilesystem' + else 'https://github.com/keplerproject/luafilesystem' + error "Could not find 'luafilesystem' module and couldn't run system command `find` (this might happen on Windows). Please install `luafilesystem` (which can be found at: #{url} or `luarocks install luafilesystem`)", 0 Files.walk = (path, flush_cache=false)-> if flush_cache |
