cell shop env var

This commit is contained in:
2026-02-10 09:13:10 -06:00
parent ad863fb89b
commit ded5f7d74b
3 changed files with 59 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
// Hidden vars (os, actorsym, init, core_path) come from env
// Hidden vars (os, actorsym, init, shop_path) come from env
var ACTORDATA = actorsym
var SYSYM = '__SYSTEM__'
@@ -52,21 +52,10 @@ function ends_with(str, suffix) {
var js = use_embed('js')
var fd = use_embed('fd')
// Get the shop path from HOME environment
var home = os.getenv('HOME') || os.getenv('USERPROFILE')
if (!home) {
os.print('Could not determine home directory\n')
os.exit(1)
}
var shop_path = home + '/.cell'
// shop_path comes from hidden env (set by cell.c)
var packages_path = shop_path + '/packages'
var core_path = packages_path + '/core'
if (!fd.is_dir(core_path)) {
os.print('Cell shop not found at ' + shop_path + '. Run "cell install" to set up.\n')
os.exit(1)
}
var use_cache = {}
use_cache['core/os'] = os