From 6f07028ad18cef1b5f914428d0f50696192c9827 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 12 Jul 2018 07:34:18 +0000 Subject: [PATCH] Ignore templates in vm list, fix mistake in copyFiles --- appvm.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/appvm.go b/appvm.go index 741caef..4f5a46c 100644 --- a/appvm.go +++ b/appvm.go @@ -114,16 +114,18 @@ func list(l *libvirt.Libvirt) { } for _, f := range files { - if f.Name() != "base.nix" && f.Name() != "local.nix" && f.Name() != "monitor.nix" { + if f.Name() != "base.nix" && + f.Name() != "local.nix" && f.Name() != "monitor.nix" && + f.Name() != "local.nix.template" && f.Name() != "monitor.nix.template" { fmt.Println("\t", f.Name()[0:len(f.Name())-4]) } } } -func copyFile(to, from string) (err error) { +func copyFile(from, to string) (err error) { source, err := os.Open(from) if err != nil { - return err + return } defer source.Close()