Skip to content

Commit

Permalink
input enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmad committed Sep 25, 2023
1 parent edfb4e1 commit fa6a63a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cmd/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import (
var dataFile string

func readInputConfig() {
viper.SetConfigType("yaml")
switch dataFile {
case ".":
// TODO: does this block ever actually ever run?
viper.SetConfigFile("./data.yaml")
case "-":
if isStdInFromTerminal() {
log.Info().Msg("Reading input directly from command line...")
log.Info().Msg("Reading input directly from command line... Press CTRL+D to stop typing")
}
viper.SetConfigType("yaml")
viper.ReadConfig(os.Stdin)
default:
viper.SetConfigFile(dataFile)
}
viper.ReadInConfig()
}

func isStdInFromTerminal() bool {
Expand Down
3 changes: 0 additions & 3 deletions src/data.yaml

This file was deleted.

0 comments on commit fa6a63a

Please sign in to comment.