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