fix: temperature, sensor
changes: - sensor temperature add - sensor temperature list - sensor temperature rm - temperature get - temperature log - temperature push
This commit is contained in:
@ -22,7 +22,6 @@ func Create(configDir string, force bool) error {
|
||||
}
|
||||
|
||||
// If no config file exists, create a new one on the location
|
||||
|
||||
if !force {
|
||||
if _, err := os.Stat(configPath); !os.IsNotExist(err) {
|
||||
return fmt.Errorf("%v already exists. Use -f to overwrite", configPath)
|
||||
@ -54,7 +53,7 @@ func Read(configDir string) (*types.Config, error) {
|
||||
|
||||
var config types.Config
|
||||
|
||||
// If no config file exists, create a new one on the location
|
||||
// If no config file exists, return an error
|
||||
if _, err := os.Stat(configPath); os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("Can not find config %v: %v", configPath, err)
|
||||
}
|
||||
@ -78,7 +77,7 @@ func Write(config *types.Config, configDir string) error {
|
||||
|
||||
configPath := filepath.Join(configDir, configFilename)
|
||||
|
||||
// If no config file exists, create a new one on the location
|
||||
// If no config file exists, return an error
|
||||
if _, err := os.Stat(configPath); os.IsNotExist(err) {
|
||||
return fmt.Errorf("Can not find config %v: %v", configPath, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user