fix(cmd): configPath variable

This commit is contained in:
2019-06-15 14:25:45 +02:00
parent 258ac998be
commit 82faa1d536
7 changed files with 20 additions and 18 deletions

View File

@ -1,10 +1,7 @@
package humidity
import (
"log"
"github.com/spf13/cobra"
"github.com/volker-raschek/flucky/pkg/humidity"
)
var follow, push bool
@ -14,9 +11,9 @@ var getHumidityCmd = &cobra.Command{
Short: "get humidity from sensor",
Run: func(cmd *cobra.Command, args []string) {
if err := humidity.Get(); err != nil {
log.Fatal(err)
}
// if err := humidity.Get(); err != nil {
// log.Fatal(err)
// }
},
}

View File

@ -4,7 +4,7 @@ import (
"github.com/spf13/cobra"
)
var configDir string
var configPath string
var humidityCmd = &cobra.Command{
Use: "humidity",
@ -12,8 +12,8 @@ var humidityCmd = &cobra.Command{
}
// Execute a
func InitCmd(cmd *cobra.Command, cnf string) {
configDir = cnf
func InitCmd(cmd *cobra.Command, cnfPath string) {
configPath = cnfPath
cmd.AddCommand(humidityCmd)