update
This commit is contained in:
@ -67,6 +67,22 @@ 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
|
||||
*/
|
||||
export let execAndWaitForLine = (commandStringArg: string, regexArg: RegExp) => {
|
||||
let done = plugins.smartq.defer()
|
||||
let execStreamingResult = execStreaming(commandStringArg)
|
||||
execStreamingResult.childProcess.on('data', (stdOutChunk: string) => {
|
||||
if (regexArg.test(stdOutChunk)) {
|
||||
done.resolve()
|
||||
}
|
||||
})
|
||||
return done.promise
|
||||
}
|
||||
|
||||
/**
|
||||
* get a path
|
||||
*/
|
||||
|
Reference in New Issue
Block a user