mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
command line args
This commit is contained in:
13
context.go
13
context.go
@@ -20,7 +20,16 @@ func NewContext(path string) Context {
|
||||
return Context{path}
|
||||
}
|
||||
|
||||
func (c *Context) Repository(name string) (Repository, error) {
|
||||
func (c *Context) Repository(name string) (*Repository, error) {
|
||||
name, err := ParseRepositoryName(name)
|
||||
return Repository{filepath.Join(c.path, name)}, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
repo, err := NewRepository(filepath.Join(c.path, name))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return repo, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user