This commit is contained in:
PhilKunz External
2017-06-27 08:28:11 +00:00
parent 92d26a574c
commit 63d5fe4f1c
9 changed files with 31 additions and 69 deletions

View File

@ -19,8 +19,8 @@ export class Smartshell {
}
}
addSourceFiles(sourceFilePathsArray: string[]) {
for(let sourceFilePath of sourceFilePathsArray) {
addSourceFiles (sourceFilePathsArray: string[]) {
for (let sourceFilePath of sourceFilePathsArray) {
this.sourceFileArray.push(sourceFilePath)
}
}

View File

@ -70,12 +70,12 @@ export let execStreaming = (commandStringArg: string) => {
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
* @param regexArg
*/
export let execAndWaitForLine = (commandStringArg: string, regexArg: RegExp) => {
let done = plugins.smartq.defer()
let execStreamingResult = execStreaming(commandStringArg)
execStreamingResult.childProcess.on('data', (stdOutChunk: string) => {
execStreamingResult.childProcess.stdout.on('data', (stdOutChunk: string) => {
if (regexArg.test(stdOutChunk)) {
done.resolve()
}