1 Star 0 Fork 29

isilent / axe.store

forked from 快编程 / axe.store 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
axe.gua 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
axe-store 提交于 2020-07-04 20:25 . init
const importPath = import('path')
const importUtil = import('util')
const axeSoftFromFile = function() {
var pathDir = importPath.pathMetaBin()
var pathJson = '{}/package_source_data/{}'.format(pathDir, 'axe.json')
var s = stringFromFile(pathJson)
var j = json.loads(s)
return j
}
const search = function(name) {
const axe = axeSoftFromFile()
const searchNames = []
for (var i = 0; i < axe.length(); i += 1) {
const item = axe[i]
const itemName = item['name']
const score = importUtil.guaStringMatchScore(name, itemName)
if (score <= 0) {
continue
} else {
const version = item['version']
const _item = {
'name': itemName,
'version': version,
'token': itemName,
'score': score,
}
searchNames.add(_item)
}
}
const sortedNames = importUtil.guaListSortByKey(searchNames, 'score', reverse=true)
return sortedNames
}
const axeSoftFromName = function(name) {
const axe = axeSoftFromFile()
var i = 0
const l = axe.length()
while (i < l) {
const item = axe[i]
const itemName = item['name']
if (itemName.lower() == name.lower()) {
return item
}
i += 1
}
}
const tokenExist = function(token) {
const b = axeSoftFromName(token)
const e = b != null
return e
}
const install = function(command) {
return importUtil.callWithoutOutput(command)
}
const get = function(name) {
const axe = axeSoftFromName(name)
const command = axe['command']
return install(command)
}
1
https://gitee.com/isilentfather/store.git
git@gitee.com:isilentfather/store.git
isilentfather
store
axe.store
master

搜索帮助