Skip to content

Commit

Permalink
Show content of the file if argument is a file name
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Sep 14, 2023
1 parent 94ad12f commit 85b2644
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package run

import (
"fmt"
"os"
"strings"

"github.com/dex4er/tf/util"
Expand All @@ -20,6 +21,8 @@ func Show(args []string) error {
noOutputs = false
} else if strings.HasPrefix(arg, "-") {
newArgs = append(newArgs, arg)
} else if _, err := os.Stat(arg); err == nil {
newArgs = append(newArgs, arg)
} else {
resources = append(resources, util.AddQuotes(arg))
}
Expand Down

0 comments on commit 85b2644

Please sign in to comment.