Skip to content

Commit

Permalink
Fix absolute path as first arg (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
obierlaire authored Feb 18, 2023
1 parent a3b56c7 commit e0e27cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ var planCmd = &cobra.Command{
log.Fatal(err)
}
if len(args) != 0 {
if strings.HasPrefix("/", args[0]) {
workdir = args[0]
terraformProject := args[0]
if strings.HasPrefix(terraformProject, "/") {
workdir = path.Dir(terraformProject)
} else {
workdir = path.Join(workdir, args[0])
workdir = path.Join(workdir, terraformProject)
}

}

viper.Set("workdir", workdir)
Expand Down

0 comments on commit e0e27cb

Please sign in to comment.