virgo-agent-toolkit / luvit-pkg

An experiment in building a package manager for luvit
Apache License 2.0
0 stars 0 forks source link

Work in Progress #1

Closed songgao closed 9 years ago

songgao commented 10 years ago

Hey guys, got some progress in 0fd76de :)

This commit switches to stream interface for dependencies (see dependencies.lua and 'dependency_satisifier.lua')

Since there doesn't seem to be a way to reliably attach to stdin when executing bash, I'm using stream-concat (https://github.com/virgo-agent-toolkit/luvit-stream/pull/4) and feed into bash -c for now.

It clones now, but not into right dir yet. It needs to change cwd for childprocess.execFile. I will look into that.

songgao commented 10 years ago

Seems to be working now :)

Try this minimum package.lua:

return {
  dependencies = {
    ["stream"] = "https://github.com/virgo-agent-toolkit/luvit-stream",
    ["stream-fs"] = "https://github.com/virgo-agent-toolkit/luvit-stream-fs",
    ["template-stream"] = "https://github.com/virgo-agent-toolkit/luvit-template-stream",
    ["resolve"] = "https://github.com/virgo-agent-toolkit/luvit-resolve",
  },
}

In the same directory, do this:

luvit /whatever/path/of/luvit-pkg/init.lua

Some of repos defined in above package.lua doesn't use dependency tables (but dependency arrays) yet so luvit-pkg will complain about it but since they all have dependencies as git submodules it'll still work.

robert-chiniquy commented 9 years ago

This was fun! @creationix is building a package manager now though. I'm going to merge this and let it stand as an interesting project. Thanks @songgao!

songgao commented 9 years ago

Thanks @robert-chiniquy ! It was a fun experience for me too. I'm glad @creationix is building one. :D

songgao commented 9 years ago

Also, feel free to rename this if the name fits the new package manager :)