-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.lua
54 lines (43 loc) · 1.48 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
-- Machu Picchu
-- a general-purpose package manager
-- `torchbear.os` return either "linux", "windows" or "android" if required to perform specific configs.
CONFIG_FILES_PATH = "./configs/"
BASE_CONF = "application.scl"
config = {}
-- FIXME windows support
config["app_store_path"] = os.getenv("HOME") .. "/.mp/packages/"
config["packages_list"] = "packages.scl"
config["app_store_url"] = "https://github.com/foundpatterns/packages"
cwd = ""
if torchbear.os == "windows" then
cwd = table.remove(arg, 2) .. "/"
end
-- TODO alternative for windows
-- requires sudo
config["mp_path"] = cwd .. "/usr/share/mp/"
config["app_store"] = cwd .. "/usr/share/"
-- config["app_store"] = os.getenv("HOME") .. "/.mp/"
config["app_store_bin"] = cwd .. "/usr/bin/"
-- FIXME: use config
if torchbear.os == "android" then
config["app_store"] = "/data/data/com.termux/files/usr/share/"
config["app_store_bin"] = "/data/data/com.termux/files/usr/bin/"
end
config["default_path"] = "./"
config["default_save_directory"] = ".mp/"
config["manifest"] = "manifest.scl"
-- SCL file keys
config["url"] = "url"
config["recursive"] = "recursive"
config["export"] = "export"
config["pluck"] = "pluck"
config["repo"] = "repo"
config["local_import"] = "local_import"
-- TODO enable the following.
--
-- function append_config(path, name)
-- config = table.merge(config, get_table_from(path, name))
-- return config
-- end
--
-- append_config(CONFIG_FILES_PATH, BASE_CONF)