diff options
Diffstat (limited to 'utils/lib/os.js')
-rwxr-xr-x | utils/lib/os.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/utils/lib/os.js b/utils/lib/os.js deleted file mode 100755 index 7bffef7..0000000 --- a/utils/lib/os.js +++ /dev/null @@ -1,29 +0,0 @@ - -var platform = require('os-platform'); -for (var name in platform) { - if (Object.prototype.hasOwnProperty.call(platform, name)) { - exports[name] = platform[name]; - } -} - -exports.system = function (command, options) { - var process = exports.popen(command, options); - return process.communicate( - '', - system.stdout, - system.stderr - ).code; -}; - -exports.command = function (command) { - var process = exports.popen(command); - var result = process.communicate(); - if (result.code !== 0) - throw new Error(result.stderr.read()); - return result.stdout.read(); -}; - -exports.enquote = function (word) { - return "'" + String(word).replace(/'/g, "'\"'\"'") + "'"; -}; - |