Fix smart compile code.

This commit is contained in:
Anna Rose 2021-08-19 23:54:40 -04:00
parent 37cbab7724
commit 05267b0283

View File

@ -17,7 +17,7 @@ function Bootstrap {
// compile the libraries // compile the libraries
for lib in libs { for lib in libs {
compileFile(program, program, debug). compileFile(lib, lib, debug).
} }
// Either run init with a terminal open... // Either run init with a terminal open...
@ -37,7 +37,7 @@ function Bootstrap {
} else { } else {
set CORE:BOOTFILENAME to "/init". set CORE:BOOTFILENAME to "/init".
} }
reboot. // reboot.
} }
} }
@ -52,8 +52,9 @@ function compileFile {
} }
compile "0:" + src. compile "0:" + src.
local srcVF is Open(src + ".ks"). local srcVF is Open("0:" + src + ".ks").
local compiledVF is Open(src + ".ksm"). local compiledVF is Open("0:" + src + ".ksm").
if srcVF:SIZE < compiledVF:SIZE { if srcVF:SIZE < compiledVF:SIZE {
CopyPath("0:" + src + ".ks", "1:" + dest + ".ks"). CopyPath("0:" + src + ".ks", "1:" + dest + ".ks").
} else { } else {
@ -70,9 +71,9 @@ function addLibs {
local contents is srcVF:ReadAll(). local contents is srcVF:ReadAll().
for line in contents { for line in contents {
if line:Contains("RunOncePath") { if line:Contains("RunOncePath") {
local start is line:Find("\""). local start is line:Find(char(34)).
local end is line:FindLast("\""). local end is line:FindLast(char(34)).
libs:Add(line:Substring(start, end - start)). libs:Add(line:Substring(start + 1, end - start - 1)).
} }
} }
} }