Skip to content

Commit

Permalink
Merge pull request #81 from silinternational/hide-debug-detail
Browse files Browse the repository at this point in the history
Release 4.0.2 -- Hide debug detail
  • Loading branch information
briskt authored Nov 8, 2024
2 parents 389f3d1 + ad098e7 commit ee9e9fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: On release published
on:
release:
types: [ 'published' ]

jobs:
changelog:
name: Update changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: rhysd/changelog-from-release/action@v3
with:
file: CHANGELOG.md
github_token: ${{ secrets.GITHUB_TOKEN }}
pull_request: true
11 changes: 8 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
cfgFile string
organization string
readOnlyMode bool
debugMode bool
errLog *log.Logger
)

Expand Down Expand Up @@ -63,16 +64,17 @@ func init() {
}

func initRoot(cmd *cobra.Command, args []string) {
getToken()

debugStr := os.Getenv("TFC_OPS_DEBUG")
if debugStr == "TRUE" || debugStr == "true" {
lib.EnableDebug()
debugMode = true
}

if readOnlyMode {
lib.EnableReadOnlyMode()
}

getToken()
}

type Credentials struct {
Expand Down Expand Up @@ -120,7 +122,10 @@ func readTerraformCredentials() (*Credentials, error) {
}

credentialsPath := filepath.Join(configDir, ".terraform.d", "credentials.tfrc.json")
fmt.Println(credentialsPath)
if debugMode {
fmt.Println("reading credentials from:", credentialsPath)
}

if _, err := os.Stat(credentialsPath); errors.Is(err, os.ErrNotExist) {
return nil, nil
} else if err != nil {
Expand Down

0 comments on commit ee9e9fd

Please sign in to comment.