Skip to content

Commit

Permalink
fix: compose bundle path is now parsed as an absolute path and added …
Browse files Browse the repository at this point in the history
…an error file not found
  • Loading branch information
Z-a-r-a-k-i committed Sep 9, 2020
1 parent 7afaacf commit 12c168a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions go/cmd/pathwar/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/dustin/go-humanize"
Expand Down Expand Up @@ -923,8 +924,12 @@ func adminChallengeFlavorAddCommand() *ffcli.Command {
}

if compose := input.ChallengeFlavor.ComposeBundle; compose != "" {
if _, err := os.Stat(compose); err == nil {
f, err := os.Open(compose)
composePath, err := filepath.Abs(compose)
if err != nil {
return errcode.TODO.Wrap(err)
}
if _, err := os.Stat(composePath); err == nil {
f, err := os.Open(composePath)
if err != nil {
return errcode.TODO.Wrap(err)
}
Expand All @@ -934,6 +939,8 @@ func adminChallengeFlavorAddCommand() *ffcli.Command {
return errcode.TODO.Wrap(err)
}
input.ChallengeFlavor.ComposeBundle = string(b)
} else {
return errcode.TODO.Wrap(err)
}
}

Expand Down

0 comments on commit 12c168a

Please sign in to comment.