File tree Expand file tree Collapse file tree 1 file changed +4
-29
lines changed Expand file tree Collapse file tree 1 file changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const windows = OperatingSystem.isWindows()
10
10
const options = "-Wall -include stdio.h"
11
11
12
12
// TODO add windows support
13
- function args ( { filepath } ) {
13
+ function CArgs ( { filepath } ) {
14
14
let cmdArgs = ""
15
15
switch ( os ) {
16
16
case "darwin" :
@@ -29,20 +29,8 @@ function args({ filepath }) {
29
29
const C = {
30
30
"File Based" : {
31
31
command : "bash" ,
32
- args ( { filepath } ) {
33
- let cmdArgs = ""
34
- switch ( os ) {
35
- case "darwin" :
36
- cmdArgs = `xcrun clang ${ options } -fcolor-diagnostics '${ filepath } ' -o /tmp/c.out && /tmp/c.out`
37
- break
38
- case "linux" :
39
- cmdArgs = `cc ${ options } '${ filepath } ' -o /tmp/c.out && /tmp/c.out`
40
- break
41
- default : {
42
- atom . notifications . addError ( `Not support on ${ os } ` )
43
- }
44
- }
45
- return [ "-c" , cmdArgs ]
32
+ args ( opts ) {
33
+ return CArgs ( opts )
46
34
} ,
47
35
} ,
48
36
@@ -51,20 +39,7 @@ const C = {
51
39
args ( context ) {
52
40
const code = context . getCode ( )
53
41
const tmpFile = GrammarUtils . createTempFileWithCode ( code , ".c" )
54
- let cmdArgs = ""
55
- switch ( os ) {
56
- case "darwin" :
57
- cmdArgs = `xcrun clang ${ options } -fcolor-diagnostics ${ tmpFile } -o /tmp/c.out && /tmp/c.out`
58
- break
59
- case "linux" :
60
- cmdArgs = `cc ${ options } ${ tmpFile } -o /tmp/c.out && /tmp/c.out`
61
- break
62
- default : {
63
- atom . notifications . addError ( `Not support on ${ os } ` )
64
- }
65
- }
66
-
67
- return [ "-c" , cmdArgs ]
42
+ return CArgs ( { filepath : tmpFile } )
68
43
} ,
69
44
} ,
70
45
}
You can’t perform that action at this time.
0 commit comments