代码拉取完成,页面将自动刷新
con importPath = import('path')
con importUtil = import('util')
con axeSoftFromDb = function(type, name) {
return importUtil.guaSearchFromDb(type, name)
}
con search = function(name) {
con type = 'axe'
con axe = axeSoftFromDb(type, name)
con searchNames = []
for (var i = 0; i < axe.length(); i += 1) {
con item = axe[i]
con itemName = item['name']
con type = item['type']
con score = importUtil.guaStringMatchScore(name, itemName)
if (score <= 0) {
continue
} else {
con version = item['version']
con _item = {
'name': itemName,
'version': version,
'token': itemName,
'score': score,
'type': type,
'installed': false,
}
searchNames.add(_item)
}
}
con sortedNames = importUtil.guaListSortByKey(searchNames, 'score', true)
return sortedNames
}
con axeSoftFromName = function(name) {
var s = importUtil.guaItemFromDb('axe',name)
if (s.length() > 0) {
var line = s.split('|')
var item = line[1]
return json.loads(item)
} else {
return null
}
}
con tokenExist = function(token) {
con b = axeSoftFromName(token)
con e = b != null
return e
}
con install = function(command) {
return importUtil.callWithoutOutput(command)
}
con getApp = function(name) {
con axe = axeSoftFromName(name)
con command = axe['command']
return install(command)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。