Skip to content

Commit

Permalink
do not allow input and output dirs to be the same for transform
Browse files Browse the repository at this point in the history
Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan committed Sep 21, 2023
1 parent 9e3f539 commit 60c81c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/shimconvert.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func (w *windupShimCommand) Validate() error {
if w.input == nil || len(w.input) == 0 {
return fmt.Errorf("input for rule file or directory must not be empty")
}
for _, r := range w.input {
if r == w.output {
return fmt.Errorf("input rule directory and output directory must be different")
}
}
// try to get abs path, if not, continue with relative path
if absPath, err := filepath.Abs(w.output); err == nil {
w.output = absPath
Expand Down

0 comments on commit 60c81c1

Please sign in to comment.