Rework tests, and move all source files into main package
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"router_backup/config"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@ -38,7 +37,7 @@ func main() {
|
||||
fmt.Printf("IPng Networks Router Backup v%s\n", Version)
|
||||
|
||||
// Load configuration
|
||||
cfg, err := config.ConfigRead(yamlFiles)
|
||||
cfg, err := ConfigRead(yamlFiles)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load config: %v", err)
|
||||
}
|
||||
@ -63,7 +62,7 @@ func main() {
|
||||
// Filter devices if --host flags are provided
|
||||
devicesToProcess := cfg.Devices
|
||||
if len(hostFilter) > 0 {
|
||||
devicesToProcess = make(map[string]config.Device)
|
||||
devicesToProcess = make(map[string]Device)
|
||||
for _, hostname := range hostFilter {
|
||||
if deviceConfig, exists := cfg.Devices[hostname]; exists {
|
||||
devicesToProcess[hostname] = deviceConfig
|
||||
|
Reference in New Issue
Block a user