File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ const { command } = GrammarUtils
12
12
13
13
const windows = GrammarUtils . OperatingSystem . isWindows ( )
14
14
15
- const args = function ( filepath , jar ) {
16
- jar = ( jar != null ? jar : path . basename ( filepath ) ) . replace ( / \. k t $ / , ".jar" )
17
- const cmd = `kotlinc '${ filepath } ' -include-runtime -d ${ jar } && java -jar ${ jar } `
18
- return GrammarUtils . formatArgs ( cmd )
19
- }
20
-
21
15
export const Java = {
22
16
"File Based" : {
23
17
command,
@@ -37,19 +31,25 @@ export const Java = {
37
31
} ,
38
32
}
39
33
34
+ function KotlinArgs ( filepath , jar ) {
35
+ const jarNew = ( jar !== null ? jar : path . basename ( filepath ) ) . replace ( / \. k t $ / , ".jar" )
36
+ const cmd = `kotlinc '${ filepath } ' -include-runtime -d ${ jarNew } && java -jar ${ jarNew } `
37
+ return GrammarUtils . formatArgs ( cmd )
38
+ }
39
+
40
40
export const Kotlin = {
41
41
"Selection Based" : {
42
42
command,
43
43
args ( context ) {
44
44
const code = context . getCode ( )
45
45
const tmpFile = GrammarUtils . createTempFileWithCode ( code , ".kt" )
46
- return args ( tmpFile )
46
+ return KotlinArgs ( tmpFile , null )
47
47
} ,
48
48
} ,
49
49
"File Based" : {
50
50
command,
51
51
args ( { filepath, filename } ) {
52
- return args ( filepath , `/tmp/${ filename } ` )
52
+ return KotlinArgs ( filepath , `/tmp/${ filename } ` )
53
53
} ,
54
54
} ,
55
55
}
You can’t perform that action at this time.
0 commit comments