+
+/** Awaitable wrapper around `child_process.exec` */
+export function execute(command: string, options: ExecOptions): Promise<string> {
+ return new Promise((resolve, reject) => {
+ exec(command, options, (err, stdout, stderr) => {
+ if (err) {
+ reject(err);
+ return;
+ }
+
+ if (stderr) {
+ reject(new Error(stderr));
+ return;
+ }
+
+ resolve(stdout.trimEnd());
+ });
+ });
+}
\ No newline at end of file