forked from vieter-v/vieter
Compare commits
No commits in common. "15b687fd618f5f21f4105ccc7d0f1465270470fe" and "af4fbc4ccc81824d1e160bf7fee87ba0b13e745a" have entirely different histories.
15b687fd61
...
af4fbc4ccc
|
|
@ -27,6 +27,3 @@ gdb.txt
|
||||||
# Generated docs
|
# Generated docs
|
||||||
_docs/
|
_docs/
|
||||||
/man/
|
/man/
|
||||||
|
|
||||||
# VLS logs
|
|
||||||
vls.log
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
URL to a PKGBUILD
|
URL to a PKGBUILD
|
||||||
* Targets with kind 'url' can provide a direct URL to a PKGBUILD instead of
|
* Targets with kind 'url' can provide a direct URL to a PKGBUILD instead of
|
||||||
providing a Git repository
|
providing a Git repository
|
||||||
* CLI commands for searching the AUR & directly adding packages
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
module aur
|
|
||||||
|
|
||||||
import cli
|
|
||||||
import console
|
|
||||||
import client
|
|
||||||
import vieter_v.aur
|
|
||||||
import vieter_v.conf as vconf
|
|
||||||
|
|
||||||
struct Config {
|
|
||||||
address string [required]
|
|
||||||
api_key string [required]
|
|
||||||
}
|
|
||||||
|
|
||||||
// cmd returns the cli module for interacting with the AUR API.
|
|
||||||
pub fn cmd() cli.Command {
|
|
||||||
return cli.Command{
|
|
||||||
name: 'aur'
|
|
||||||
description: 'Interact with the AUR.'
|
|
||||||
commands: [
|
|
||||||
cli.Command{
|
|
||||||
name: 'search'
|
|
||||||
description: 'Search for packages.'
|
|
||||||
required_args: 1
|
|
||||||
execute: fn (cmd cli.Command) ? {
|
|
||||||
c := aur.new()
|
|
||||||
pkgs := c.search(cmd.args[0])?
|
|
||||||
data := pkgs.map([it.name, it.description])
|
|
||||||
|
|
||||||
println(console.pretty_table(['name', 'description'], data)?)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
cli.Command{
|
|
||||||
name: 'add'
|
|
||||||
usage: 'repo pkg-name [pkg-name...]'
|
|
||||||
description: 'Add the given AUR package(s) to Vieter. Non-existent packages will be silently ignored.'
|
|
||||||
required_args: 2
|
|
||||||
execute: fn (cmd cli.Command) ? {
|
|
||||||
config_file := cmd.flags.get_string('config-file')?
|
|
||||||
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?
|
|
||||||
|
|
||||||
c := aur.new()
|
|
||||||
pkgs := c.info(cmd.args[1..])?
|
|
||||||
|
|
||||||
vc := client.new(conf.address, conf.api_key)
|
|
||||||
|
|
||||||
for pkg in pkgs {
|
|
||||||
vc.add_target(
|
|
||||||
kind: 'git'
|
|
||||||
url: 'https://aur.archlinux.org/$pkg.package_base' + '.git'
|
|
||||||
repo: cmd.args[0]
|
|
||||||
) or {
|
|
||||||
println('Failed to add $pkg.name: $err.msg()')
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
println('Added $pkg.name' + '.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,6 @@ import console.targets
|
||||||
import console.logs
|
import console.logs
|
||||||
import console.schedule
|
import console.schedule
|
||||||
import console.man
|
import console.man
|
||||||
import console.aur
|
|
||||||
import cron
|
import cron
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
@ -32,7 +31,6 @@ fn main() {
|
||||||
logs.cmd(),
|
logs.cmd(),
|
||||||
schedule.cmd(),
|
schedule.cmd(),
|
||||||
man.cmd(),
|
man.cmd(),
|
||||||
aur.cmd(),
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
app.setup()
|
app.setup()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
Module {
|
Module {
|
||||||
dependencies: [
|
dependencies: [
|
||||||
'https://git.rustybever.be/vieter-v/conf',
|
'https://git.rustybever.be/vieter-v/conf',
|
||||||
'https://git.rustybever.be/vieter-v/docker',
|
'https://git.rustybever.be/vieter-v/docker'
|
||||||
'https://git.rustybever.be/vieter-v/aur'
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue