remove tmpfile if no diff changes present
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -86,6 +86,10 @@ func writePatch(configPath string, yamlOutput []byte) error {
|
|||||||
cmd := exec.Command("diff", "-u", path.Join(configPath, configFilename), tmpFile)
|
cmd := exec.Command("diff", "-u", path.Join(configPath, configFilename), tmpFile)
|
||||||
stdout, err := cmd.Output()
|
stdout, err := cmd.Output()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
err = os.Remove(tmpFile)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
fmt.Println("no changes, your config is up to date")
|
fmt.Println("no changes, your config is up to date")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user