fix(cmd): configPath variable
This commit is contained in:
@ -18,7 +18,7 @@ var listTemperatureCmd = &cobra.Command{
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
// read configuration
|
||||
cnf, err := config.Read(cnfPath)
|
||||
cnf, err := config.Read(configPath)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ var readTemperatureCmd = &cobra.Command{
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
// read configuration
|
||||
cnf, err := config.Read(cnfPath)
|
||||
cnf, err := config.Read(configPath)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var cnfPath string
|
||||
var configPath string
|
||||
|
||||
var temperatureCmd = &cobra.Command{
|
||||
Use: "temperature",
|
||||
@ -15,8 +15,8 @@ var temperatureCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
// Execute a
|
||||
func InitCmd(cmd *cobra.Command, configPath string) {
|
||||
cnfPath = configPath
|
||||
func InitCmd(cmd *cobra.Command, cnfPath string) {
|
||||
configPath = cnfPath
|
||||
cmd.AddCommand(temperatureCmd)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user