From 2b4af1e4cafdb24db0a5711da1f348337f96e214 Mon Sep 17 00:00:00 2001 From: annabunches Date: Tue, 3 Aug 2021 17:08:13 -0400 Subject: [PATCH] Program to clean up after our compile test. --- clean.ks | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 clean.ks diff --git a/clean.ks b/clean.ks new file mode 100644 index 0000000..933a575 --- /dev/null +++ b/clean.ks @@ -0,0 +1,34 @@ +// Intended to be run from volume 0 for checking compiled sizes. + +switch to 0. +cleanHere(). + +function cleanDir { + parameter dir. + + print "Entering '" + dir + "'.". + cd(dir). + compileHere(). + cd(".."). + print "Leaving '" + dir + "'.". +} + +function cleanHere { + local fileList is list(). + list files in fileList. + + for f in fileList { + if f:ISFILE { + if f:EXTENSION = "ksm" { + print "Deleting '" + f:NAME + "'.". + deletepath(f). + } + } else if f:NAME[0] <> "." { + compileDir(f). + } + } +} + + // TODO: might be neat to actually do a filesize comparison and print a report or something, + // specifically iterating files NOT to compile. + // TODO: We could hypothetically even integrate this with the bootstrapper.