Skip to content

Commit 5b10e3b

Browse files
committed
fix: use createTempPath in fortran grammar
1 parent 256b8bb commit 5b10e3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/grammars/fortran.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const FortranFixedForm = {
77
"File Based": {
88
command,
99
args({ filepath }) {
10-
const cmd = `gfortran '${filepath}' -ffixed-form -o /tmp/f.out && /tmp/f.out`
10+
const tempOutFile = GrammarUtils.createTempPath("f-", ".out")
11+
const cmd = `gfortran '${filepath}' -ffixed-form -o ${tempOutFile} && ${tempOutFile}`
1112
return GrammarUtils.formatArgs(cmd)
1213
},
1314
},
@@ -16,7 +17,8 @@ const FortranFreeForm = {
1617
"File Based": {
1718
command,
1819
args({ filepath }) {
19-
const cmd = `gfortran '${filepath}' -ffree-form -o /tmp/f90.out && /tmp/f90.out`
20+
const tempOutFile = GrammarUtils.createTempPath("f90-", ".out")
21+
const cmd = `gfortran '${filepath}' -ffree-form -o ${tempOutFile} && ${tempOutFile}`
2022
return GrammarUtils.formatArgs(cmd)
2123
},
2224
},

0 commit comments

Comments
 (0)