Skip to content

Commit c61bb75

Browse files
committed
fix: use createTempPath in Obj-c and Obj-cpp grammar
1 parent 6db2dfa commit c61bb75

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/grammars/c.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ const ObjectiveC = {
149149
"File Based": {
150150
command: "bash",
151151
args({ filepath }) {
152+
const tempOutFile = GrammarUtils.createTempPath("objc-", ".out")
152153
return [
153154
"-c",
154-
`xcrun clang ${options} -fcolor-diagnostics -framework Cocoa '${filepath}' -o /tmp/objc-c.out && /tmp/objc-c.out`,
155+
`xcrun clang ${options} -fcolor-diagnostics -framework Cocoa '${filepath}' -o ${tempOutFile} && ${tempOutFile}`,
155156
]
156157
},
157158
},
@@ -161,9 +162,10 @@ const ObjectiveCpp = {
161162
"File Based": {
162163
command: "bash",
163164
args({ filepath }) {
165+
const tempOutFile = GrammarUtils.createTempPath("objcpp-", ".out")
164166
return [
165167
"-c",
166-
`xcrun clang++ -Wc++11-extensions ${options} -fcolor-diagnostics -include iostream -framework Cocoa '${filepath}' -o /tmp/objc-cpp.out && /tmp/objc-cpp.out`,
168+
`xcrun clang++ -Wc++11-extensions ${options} -fcolor-diagnostics -include iostream -framework Cocoa '${filepath}' -o ${tempOutFile} && ${tempOutFile}`,
167169
]
168170
},
169171
},

0 commit comments

Comments
 (0)