Skip to content

Commit

Permalink
modified: vault.go
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Aug 24, 2017
1 parent 8c47201 commit 3f68fde
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,21 @@ func New(f, k, u, o, v string) (*vault, error) {
if err != nil {
return nil, err
}
} else if !cache.IsFile(keyPath) {
} else if !cache.IsFile(keyPath) && !isURL.MatchString(k) {
return nil, fmt.Errorf("SSH key %q not found or unable to read", keyPath)
}
if o == "create" {
switch o {
case "create":
if v != "" && cache.IsFile(v) {
return nil, fmt.Errorf("File already exists: %q", v)
}
case "view":
if isURL.MatchString(k) {
keyPath, err = cache.Get(s, k, "", 0)
if err != nil {
return nil, err
}
}
}
return &vault{
key: keyPath,
Expand Down

0 comments on commit 3f68fde

Please sign in to comment.