mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-05 22:08:27 +00:00
Use temp file with .png extension.
This commit is contained in:
@@ -114,8 +114,11 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tempfile.Close()
|
tempfile.Close()
|
||||||
|
os.Remove(tempfile.Name())
|
||||||
|
|
||||||
command := exec.Command("dot", "-Tpng", "-o"+tempfile.Name())
|
tempfilename := tempfile.Name() + ".png"
|
||||||
|
|
||||||
|
command := exec.Command("dot", "-Tpng", "-o"+tempfilename)
|
||||||
command.Stderr = os.Stderr
|
command.Stderr = os.Stderr
|
||||||
|
|
||||||
stdin, err := command.StdinPipe()
|
stdin, err := command.StdinPipe()
|
||||||
@@ -143,9 +146,9 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = exec.Command("open", tempfile.Name()).Run()
|
err = exec.Command("open", tempfilename).Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Rendered to PNG file: %s\n", tempfile.Name())
|
fmt.Printf("Rendered to PNG file: %s\n", tempfilename)
|
||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user