File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,10 @@ const rimraf = path.join(
24
24
)
25
25
26
26
function coffeeArgs ( { filepath } ) {
27
- const jsFile = filepath . replace ( path . extname ( filepath ) , ".js" )
28
- const cmd = `'${ coffee } ' --compile '${ filepath } ' && ${ babel } ${ jsFile } --config-file ${ babelConfig } ' && ${ rimraf } ${ jsFile } `
27
+ let filePathOutput = filepath
28
+ const extension = filepath . substring ( filepath . indexOf ( "." ) + 1 )
29
+ filePathOutput = filePathOutput . replace ( extension , "js" )
30
+ const cmd = `'${ coffee } ' --compile '${ filepath } ' && ${ babel } ${ filePathOutput } --config-file ${ babelConfig } ' && ${ rimraf } ${ filePathOutput } `
29
31
return GrammarUtils . formatArgs ( cmd )
30
32
}
31
33
@@ -35,10 +37,11 @@ const CoffeeScript = {
35
37
args ( context ) {
36
38
const editor = atom . workspace . getActiveTextEditor ( )
37
39
const scopeName = editor ? editor . getGrammar ( ) . scopeName : null
38
- const lit = scopeName !== null && scopeName . includes ( "lit" ) ? "lit" : ""
40
+ const isLiterate = scopeName !== null && scopeName . includes ( "lit" )
41
+ const lit = isLiterate ? "lit" : ""
39
42
const code = context . getCode ( )
40
43
const filepath = GrammarUtils . createTempFileWithCode ( code , `.${ lit } coffee` )
41
- return coffeeArgs ( { filepath } )
44
+ return coffeeArgs ( { filepath, isLiterate } )
42
45
} ,
43
46
} ,
44
47
"File Based" : { command, args : coffeeArgs } ,
You can’t perform that action at this time.
0 commit comments