From e8c335a787b6e686bd4eced39a07e67196ff60db Mon Sep 17 00:00:00 2001 From: Bernard Helyer Date: Fri, 25 Nov 2016 22:20:56 +1300 Subject: [PATCH] driver: Try and add project to Tesla config. --- src/battery/driver.volt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/battery/driver.volt b/src/battery/driver.volt index b9fa345..2d9c40d 100644 --- a/src/battery/driver.volt +++ b/src/battery/driver.volt @@ -566,7 +566,18 @@ Normal usecase when standing in a project directory. foreach (i, arg; gen.genVoltaArgs(testProject)) { ofs.writef("\"%s\", ", slashEscape(arg)); } - ofs.writefln("\"%s\", \"%s\"]}\n }\n}", rtpath, wattpath); + ofs.writef("\"%s\", \"%s\"]}", rtpath, wattpath); + exe := cast(Exe)testProject; + if (exe !is null) { + exepath := slashEscape("." ~ dirSeparator ~ exe.bin); + version (Windows) { + if (!endsWith(exepath, ".exe")) { + exepath ~= ".exe"; + } + } + ofs.writefln(",\n \"%s\": {\"path\": \"%s\", \"args\":[]}", exe.name, exepath); + } + ofs.writefln(" }\n}"); ofs.flush(); ofs.close(); }