mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-12 14:11:50 +09:00
9 lines
407 B
JavaScript
9 lines
407 B
JavaScript
if (exec_args[1] === undefined) {
|
|
println("Usage: compile myfile.js")
|
|
println("The compiled file will be myfile.bin")
|
|
return 1
|
|
}
|
|
const filenameWithoutExt = exec_args[1].substringBeforeLast(".")
|
|
_G.shell.execute(`gzip -c ${exec_args[1]} | writeto ${filenameWithoutExt}.gz`)
|
|
_G.shell.execute(`enc ${filenameWithoutExt}.gz ${filenameWithoutExt}.bin`)
|
|
_G.shell.execute(`rm ${filenameWithoutExt}.gz`) |