Last active
January 17, 2020 12:39
-
-
Save shaharkazaz/57e5ecaf8776911e7c5bcc9a6e01d377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const shell = require('shelljs'); | |
| function exec(cmd, options) { | |
| const defaultOptions = {silent: true}; | |
| let output = shell.exec(cmd, {...defaultOptions, ...(options || {})}); | |
| if (options && options.toString !== false) { | |
| output = output.toString(); | |
| output = options.trim ? output.trim() : output; | |
| } | |
| return output; | |
| } | |
| exports.exec = exec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment