@@ -569,15 +569,21 @@ const OtherGrammars = {
569
569
"File Based" : {
570
570
command : "bash" ,
571
571
args ( { filepath } ) {
572
- const args = ( ( ) => {
573
- switch ( arch ) {
574
- case "x32" :
575
- return `nasm -f elf '${ filepath } ' -o /tmp/asm.out.o && ld -m elf_i386 /tmp/asm.out.o -o /tmp/asm.out && /tmp/asm.out`
576
- case "x64" :
577
- return `nasm -f elf64 '${ filepath } ' -o /tmp/asm.out.o && ld /tmp/asm.out.o -o /tmp/asm.out && /tmp/asm.out`
572
+ const tempOutOFile = GrammarUtils . createTempPath ( "asm-" , ".out.o" )
573
+ const tempOutFile = GrammarUtils . createTempPath ( "asm-" , ".out" )
574
+ let cmadArgs = ""
575
+ switch ( arch ) {
576
+ case "x32" :
577
+ cmadArgs = `nasm -f elf '${ filepath } ' -o ${ tempOutOFile } && ld -m elf_i386 ${ tempOutOFile } -o ${ tempOutFile } && ${ tempOutFile } `
578
+ break
579
+ case "x64" :
580
+ cmadArgs = `nasm -f elf64 '${ filepath } ' -o ${ tempOutOFile } && ld ${ tempOutOFile } -o ${ tempOutFile } && ${ tempOutFile } `
581
+ break
582
+ default : {
583
+ atom . notifications . addError ( `Not supported on ${ arch } ` )
578
584
}
579
- } ) ( )
580
- return [ "-c" , args ]
585
+ }
586
+ return [ "-c" , cmadArgs ]
581
587
} ,
582
588
} ,
583
589
@@ -586,15 +592,21 @@ const OtherGrammars = {
586
592
args ( context ) {
587
593
const code = context . getCode ( )
588
594
const tmpFile = GrammarUtils . createTempFileWithCode ( code , ".asm" )
589
- const args = ( ( ) => {
590
- switch ( arch ) {
591
- case "x32" :
592
- return `nasm -f elf '${ tmpFile } ' -o /tmp/asm.out.o && ld -m elf_i386 /tmp/asm.out.o -o /tmp/asm.out && /tmp/asm.out`
593
- case "x64" :
594
- return `nasm -f elf64 '${ tmpFile } ' -o /tmp/asm.out.o && ld /tmp/asm.out.o -o /tmp/asm.out && /tmp/asm.out`
595
+ const tempOutOFile = GrammarUtils . createTempPath ( "asm-" , ".out.o" )
596
+ const tempOutFile = GrammarUtils . createTempPath ( "asm-" , ".out" )
597
+ let cmdArgs = ""
598
+ switch ( arch ) {
599
+ case "x32" :
600
+ cmdArgs = `nasm -f elf '${ tmpFile } ' -o ${ tempOutOFile } && ld -m elf_i386 ${ tempOutOFile } -o ${ tempOutFile } && ${ tempOutFile } `
601
+ break
602
+ case "x64" :
603
+ cmdArgs = `nasm -f elf64 '${ tmpFile } ' -o ${ tempOutOFile } && ld ${ tempOutOFile } -o ${ tempOutFile } && ${ tempOutFile } `
604
+ break
605
+ default : {
606
+ atom . notifications . addError ( `Not supported on ${ arch } ` )
595
607
}
596
- } ) ( )
597
- return [ "-c" , args ]
608
+ }
609
+ return [ "-c" , cmdArgs ]
598
610
} ,
599
611
} ,
600
612
} ,
0 commit comments