aboutsummaryrefslogtreecommitdiff
path: root/docker/netiquette/src/io/run.mjs
blob: 87740431082a84c3385312911b93e2a0f83c53a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
'use strict'

import child_process from 'child_process'

export const exec = (cmd, opts) =>
  new Promise((resolve, reject) =>
    child_process.exec(cmd, opts, (error, stdout, stderr) =>
      error ? reject({err: error, stdout: stdout, stderr: stderr}) : resolve({stdout: stdout, stderr: stderr})))