Implements update repos wrapper
This commit is contained in:
parent
6c72b5de00
commit
af5691b0d4
@ -55,6 +55,10 @@ You need to **relogin** if you install virt-manager (libvirt) first time.
|
|||||||
$ appvm start chromium
|
$ appvm start chromium
|
||||||
$ # ... long wait for first time, because we need to collect a lot of packages
|
$ # ... long wait for first time, because we need to collect a lot of packages
|
||||||
|
|
||||||
|
## Synchronize remote repos for applications
|
||||||
|
|
||||||
|
$ appvm sync
|
||||||
|
|
||||||
You can customize local settings in **~/.config/appvm/nix/local.nix**.
|
You can customize local settings in **~/.config/appvm/nix/local.nix**.
|
||||||
|
|
||||||
Default hotkey to release cursor: ctrl+alt.
|
Default hotkey to release cursor: ctrl+alt.
|
||||||
|
18
appvm.go
18
appvm.go
@ -327,6 +327,20 @@ func search(name string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sync() {
|
||||||
|
err := exec.Command("nix-channel", "--update").Run()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = exec.Command("nix", "search", "-u").Run()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("Done")
|
||||||
|
}
|
||||||
|
|
||||||
var configDir = os.Getenv("HOME") + "/.config/appvm/"
|
var configDir = os.Getenv("HOME") + "/.config/appvm/"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -375,6 +389,8 @@ func main() {
|
|||||||
searchCommand := kingpin.Command("search", "Search for application")
|
searchCommand := kingpin.Command("search", "Search for application")
|
||||||
searchName := searchCommand.Arg("name", "Application name").Required().String()
|
searchName := searchCommand.Arg("name", "Application name").Required().String()
|
||||||
|
|
||||||
|
kingpin.Command("sync", "Synchronize remote repos for applications")
|
||||||
|
|
||||||
switch kingpin.Parse() {
|
switch kingpin.Parse() {
|
||||||
case "list":
|
case "list":
|
||||||
list(l)
|
list(l)
|
||||||
@ -390,5 +406,7 @@ func main() {
|
|||||||
drop(*dropName)
|
drop(*dropName)
|
||||||
case "autoballoon":
|
case "autoballoon":
|
||||||
autoBalloon(l, *minMemory*1024, *adjustPercent)
|
autoBalloon(l, *minMemory*1024, *adjustPercent)
|
||||||
|
case "sync":
|
||||||
|
sync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user