diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-08-20 18:18:36 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-08-20 18:18:36 +0200 |
commit | 9a1aa7fe443438fdfdab89d77aa07c51b633644c (patch) | |
tree | 1d90ea6007fc59c3012efb17d14370c890b2805e /main.go | |
parent | 9f98d6ef4931f04b9023264f0e3408e4529c977d (diff) | |
download | dna-backup-9a1aa7fe443438fdfdab89d77aa07c51b633644c.tar.gz dna-backup-9a1aa7fe443438fdfdab89d77aa07c51b633644c.zip |
initial repo tree
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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 <source> <dest>") + 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) } |