From 9a1aa7fe443438fdfdab89d77aa07c51b633644c Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 20 Aug 2021 18:18:36 +0200 Subject: initial repo tree --- main.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index f8a38ae..f70faa4 100644 --- a/main.go +++ b/main.go @@ -1,19 +1,20 @@ package main import ( + "fmt" "os" ) func main() { - path := "." - if len(os.Args) > 1 { - path = os.Args[1] + if len(os.Args) != 3 { + fmt.Println("usage: dna-backup ") + os.Exit(1) } - files := make(chan File) - chunks := make(chan []byte) - go ListFiles(path, files) - go ReadFiles(files, chunks) - StoreChunks(".", chunks) + source := os.Args[1] + dest := os.Args[2] + + os.MkdirAll(dest, 0775) + Commit(source, dest) } -- cgit v1.2.3