github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/internal/config/handle_show.go (about)

     1  package configPkg
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/config"
     7  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/file"
     8  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/logger"
     9  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/output"
    10  )
    11  
    12  func (opts *ConfigOptions) HandleShow(rCtx *output.RenderCtx) error {
    13  	if opts.Mode == "edit" {
    14  		return opts.HandleEdit(rCtx)
    15  	}
    16  
    17  	if opts.Globals.TestMode {
    18  		logger.Info("Can not process this command in test mode.")
    19  		return nil
    20  	}
    21  
    22  	fmt.Printf("%s", file.AsciiFileToString(config.PathToConfigFile()))
    23  	return nil
    24  }