Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revis...
[WebKit-https.git] / Websites / perf.webkit.org / tools / js / subprocess.js
1 'use strict';
2 const childProcess = require('child_process').ChildProcess;
3
4 class Subprocess {
5     execute(command) {
6         return new Promise((resolve, reject) => {
7             this._childProcess.execFile(command[0], command.slice(1), (error, stdout, stderr) => {
8                 if (error)
9                     reject(stderr);
10                 else
11                     resolve(stdout);
12             });
13         });
14     }
15 };
16
17 if (typeof module != 'undefined')
18     module.exports.Subprocess = Subprocess;