1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +00:00
restic/cmd/khepri/cmd_init.go
Alexander Neumann 03ca69407d Add method to create repository
Also disables automatic creation on open
2014-09-23 21:16:54 +02:00

20 lines
336 B
Go

package main
import (
"fmt"
"os"
"github.com/fd0/khepri"
)
func commandInit(path string) error {
repo, err := khepri.CreateRepository(path)
if err != nil {
fmt.Fprintf(os.Stderr, "creating repository at %s failed: %v\n", path, err)
os.Exit(1)
}
fmt.Printf("created khepri repository at %s\n", repo.Path())
return nil
}