forked from qt-creator/qt-creator
qbs build: Add convenience function for reading process output.
Change-Id: I998ec20de032b59448585c851e79912010cdac08 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
committed by
Joerg Bornemann
parent
99f43c94c6
commit
60abd3f0a1
11
qbs/imports/QtcProcessOutputReader/procoutputreader.js
Normal file
11
qbs/imports/QtcProcessOutputReader/procoutputreader.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
var Process = loadExtension("qbs.Process")
|
||||||
|
|
||||||
|
function readOutput(executable, args)
|
||||||
|
{
|
||||||
|
var p = new Process();
|
||||||
|
var output = "";
|
||||||
|
if (p.exec(executable, args, false) !== -1)
|
||||||
|
output = p.readStdOut().trim(); // Trailing newline.
|
||||||
|
p.close();
|
||||||
|
return output;
|
||||||
|
}
|
Reference in New Issue
Block a user