Merge pull request #47 from osctobe/master

Create tempfile in the output directory
This commit is contained in:
Álvaro López Espinosa 2019-05-25 14:29:03 +01:00 committed by GitHub
commit ddc705194a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -134,7 +134,8 @@ func main() {
}
// Write to tmpfile first
tmpFile, err := ioutil.TempFile("", fmt.Sprintf("%s_enumer_", types[0]))
tmpName := fmt.Sprintf("%s_enumer_", filepath.Base(types[0]))
tmpFile, err := ioutil.TempFile(filepath.Dir(types[0]), tmpName)
if err != nil {
log.Fatalf("creating temporary file for output: %s", err)
}