30 Star 207 Fork 29

快编程 / axe.store

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
axe.gua 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
dudu_axe 提交于 2022-06-22 20:10 . axe.store 2.0.0
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)
}
1
https://gitee.com/kuaibiancheng/store.git
git@gitee.com:kuaibiancheng/store.git
kuaibiancheng
store
axe.store
master

搜索帮助