grabbing module works now
This commit is contained in:
@@ -78,8 +78,20 @@ function get_normalized_package(path, ctx)
|
||||
|
||||
// taking the package into account, find the canonical name
|
||||
function get_normalized_module(mod, ctx) {
|
||||
var deps = Shop.load_config(ctx);
|
||||
return deps.dependencies[mod]
|
||||
var cfg = Shop.load_config(ctx)
|
||||
|
||||
if (!cfg || !cfg.dependencies)
|
||||
return null
|
||||
|
||||
var locator = cfg.dependencies[mod]
|
||||
if (!locator)
|
||||
return null
|
||||
|
||||
var parsed = Shop.parse_locator(locator)
|
||||
if (!parsed)
|
||||
return null
|
||||
|
||||
return parsed.path
|
||||
}
|
||||
|
||||
function get_import_dl(name) {
|
||||
@@ -512,7 +524,8 @@ function resolve_c_symbol(path, package_ctx)
|
||||
|
||||
function mod_scriptor(name, script)
|
||||
{
|
||||
return `(function setup_${name}_module($_){${script}})`
|
||||
// TODO: need a safe name here
|
||||
return `(function setup_module($_){${script}})`
|
||||
}
|
||||
|
||||
function eval_mod(path, script, c_sym)
|
||||
|
||||
Reference in New Issue
Block a user