mirror of
https://github.com/Ellpeck/TinyLifeExampleMod.git
synced 2024-11-27 14:08:34 +01:00
Compare commits
No commits in common. "80309a73a53a500861a56009cf99067ebdd2031f" and "eb4bebe12a381fc1ff8b24ff2a08a648065006f8" have entirely different histories.
80309a73a5
...
eb4bebe12a
1 changed files with 4 additions and 8 deletions
12
build.cake
12
build.cake
|
@ -31,12 +31,8 @@ Task("Run").IsDependentOn("CopyToMods").Does(() => {
|
|||
var exeDir = System.IO.File.ReadAllText($"{tinyLifeDir}/GameDir");
|
||||
var process = Process.Start(new ProcessStartInfo($"{exeDir}/Tiny Life") {
|
||||
Arguments = $"-v --skip-splash --skip-preloads --debug-saves --ansi {args}",
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
CreateNoWindow = true
|
||||
});
|
||||
// make sure the output buffers (which we ignore) don't fill up
|
||||
process.BeginOutputReadLine();
|
||||
process.BeginErrorReadLine();
|
||||
|
||||
// we wait a bit to make sure the process has generated a new log file
|
||||
Thread.Sleep(1000);
|
||||
|
@ -49,12 +45,12 @@ Task("Run").IsDependentOn("CopyToMods").Does(() => {
|
|||
using (var reader = new StreamReader(stream)) {
|
||||
var lastPos = 0L;
|
||||
do {
|
||||
if (stream.Length > lastPos) {
|
||||
stream.Seek(lastPos, SeekOrigin.Begin);
|
||||
if (reader.BaseStream.Length > lastPos) {
|
||||
reader.BaseStream.Seek(lastPos, SeekOrigin.Begin);
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
Information(line);
|
||||
lastPos = stream.Position;
|
||||
lastPos = reader.BaseStream.Position;
|
||||
}
|
||||
Thread.Sleep(10);
|
||||
} while (!process.HasExited);
|
||||
|
|
Loading…
Reference in a new issue