mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
video delta encoding wip
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
if (exec_args[1] === undefined) {
|
||||
println("Usage: compile myfile")
|
||||
println("Usage: compile myfile.js")
|
||||
println("The compiled file will be myfile.bin")
|
||||
return 1
|
||||
}
|
||||
|
||||
_G.shell.execute(`gzip -c ${exec_args[1]} | writeto ${exec_args[1]}.gz`)
|
||||
_G.shell.execute(`enc ${exec_args[1]}.gz ${exec_args[1]}.bin`)
|
||||
_G.shell.execute(`rm ${exec_args[1]}.gz`)
|
||||
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`)
|
||||
@@ -3,7 +3,6 @@ if (exec_args[1] === undefined) {
|
||||
println("The compiled file will be myfile.bin.js")
|
||||
return 1
|
||||
}
|
||||
|
||||
_G.shell.execute(`enc ${exec_args[1]} ${exec_args[1]}.gz`)
|
||||
_G.shell.execute(`gzip -c -d ${exec_args[1]}.gz | writeto ${exec_args[1]}.js`)
|
||||
_G.shell.execute(`rm ${exec_args[1]}.gz`)
|
||||
@@ -8,7 +8,10 @@ if (exec_args[1] === undefined || exec_args[2] === undefined) {
|
||||
|
||||
let infilePath = _G.shell.resolvePathInput(exec_args[2]).full
|
||||
let infile = files.open(infilePath)
|
||||
let outfile = files.open(infilePath + ".out")
|
||||
|
||||
if (!infile.exists) throw Error("No such file: " + infilePath)
|
||||
|
||||
let outfile = files.open(infilePath.substringBeforeLast(".") + ".out")
|
||||
let outMode = exec_args[1].toLowerCase()
|
||||
|
||||
let type = {
|
||||
|
||||
Reference in New Issue
Block a user