Comments (1)
Maybe this could be fixed by adding a base function, ie deps.base
which is called by deps.run
and can be used without it
local log = require 'loverocks.log'
local luarocks = require 'loverocks.luarocks'
local deps = {}
function deps.build(parser)
parser:description
"Installs all packages listed as dependencies in your conf.lua file."
parser:option "-s" "--server"
:description
"Fetch rocks/rockspecs from this server as a priority."
parser:option "--only-server"
:description
"Fetch rocks/rockspecs from this server, ignoring other servers."
end
function deps.base(dep_list, flags)
log:fs("luarocks install <> --only-deps")
log:assert(luarocks.sandbox(flags, function()
local lr_deps = require 'luarocks.deps'
local parsed_deps = {}
for _, s in ipairs(dep_list) do
table.insert(parsed_deps, lr_deps.parse_dep(s))
end
return lr_deps.fulfill_dependencies({
name = flags.name or 'LOVE_GAME',
version = "(love)",
dependencies = parsed_deps
}, "one")
end))
log:info("Dependencies installed succesfully!")
end
function deps.run(conf, args)
if conf._loverocks_no_config then
log:error("conf.lua error: %s", conf._loverocks_no_config)
end
if not conf.dependencies then
log:error("please add a dependency table to your conf.lua FIXME: better error")
end
local flags = luarocks.make_flags(conf)
flags.init_rocks = true
flags.name = conf.identity or "LOVE_GAME"
assert(type(flags.name) == 'string')
if args.server then
table.insert(flags.from, 1, args.server)
end
if args.only_server then
flags.only_from = args.only_server
end
deps.base(conf.dependencies, flags)
end
return deps
from loverocks.
Related Issues (19)
- Error: Could not satisfy dependency: love ~> 0.9 HOT 7
- Dependency importing
- Remove dependency on luafilesystem HOT 3
- 64-bit luarocks on windows? HOT 3
- Not installable via luarocks HOT 2
- remove stale dependencies HOT 1
- Support for Lua 5.3 HOT 2
- Love version 11.0 incorrectly supported HOT 1
- `loverocks init` fails with not finding `templates` HOT 5
- module 'luarocks.cfg' not found HOT 3
- loverocks new fail due to nil value
- Dependency freezing
- Support packed games
- loverocks install --only-deps is broken
- Cannot Install loverocks on Windows HOT 3
- public API?
- increasing the lua version upper bound HOT 4
- Improving the getting started story for new users HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loverocks.