# Github tokens used to access data.
var tokens: Array[String] is lazy do
- var arr = opt_tokens.value
- if arr.is_empty then
- var iarr = ini.at("tokens")
- if iarr != null then arr = iarr.values.to_a
+ var opt_tokens = self.opt_tokens.value
+ if opt_tokens.not_empty then return opt_tokens
+
+ var res = new Array[String]
+ var ini_tokens = ini.section("tokens")
+ if ini_tokens == null then return res
+
+ for token in ini_tokens.values do
+ if token == null then continue
+ res.add token
end
- return arr or else new Array[String]
+ return res
end
# Github tokens wallet\13
# Attach homonymous `ini` file to the package
var inipath = path.dirname / "{pn}.ini"
if inipath.file_exists then
- var ini = new ConfigTree(inipath)
+ var ini = new IniFile.from_file(inipath)
mpackage.ini = ini
end
end
var parent = null
var inipath = dirpath / "package.ini"
if inipath.file_exists then
- ini = new ConfigTree(inipath)
+ ini = new IniFile.from_file(inipath)
end
if ini == null then
# The `ini` file is given as is and might contain invalid or missing information.
#
# Some packages, like stand-alone packages or virtual packages have no `ini` file associated.
- var ini: nullable ConfigTree = null
+ var ini: nullable IniFile = null
# Array of relative source paths excluded according to the `source.exclude` key of the `ini`
var excludes: nullable Array[String] is lazy do