From 1a9734f2655c8b0710a1fe04ffd8e0675054fea2 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Wed, 3 Dec 2025 15:39:49 -0600 Subject: [PATCH] grabbing module works now --- scripts/shop.cm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/shop.cm b/scripts/shop.cm index e0e476c0..b37d7899 100644 --- a/scripts/shop.cm +++ b/scripts/shop.cm @@ -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)