aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-08-20 18:18:36 +0200
committern-peugnet <n.peugnet@free.fr>2021-08-20 18:18:36 +0200
commit9a1aa7fe443438fdfdab89d77aa07c51b633644c (patch)
tree1d90ea6007fc59c3012efb17d14370c890b2805e /main.go
parent9f98d6ef4931f04b9023264f0e3408e4529c977d (diff)
downloaddna-backup-9a1aa7fe443438fdfdab89d77aa07c51b633644c.tar.gz
dna-backup-9a1aa7fe443438fdfdab89d77aa07c51b633644c.zip
initial repo tree
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 9 insertions, 8 deletions
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 <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)
}