From 44ea97c19c52073d19c3af80db1a354558f6c16a Mon Sep 17 00:00:00 2001 From: Iskren Slavov Date: Sun, 26 Jun 2016 09:24:30 +0300 Subject: [PATCH] Do not redefine global Promise when it is available --- lib/list-unix.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/list-unix.js b/lib/list-unix.js index af391a3..3e3201d 100644 --- a/lib/list-unix.js +++ b/lib/list-unix.js @@ -1,5 +1,9 @@ 'use strict'; -var Promise = require('es6-promise').Promise; + +var Promise = typeof global.Promise == 'function' + ? global.Promise + : require('es6-promise').Promise; + var childProcess = require('child_process'); var fs = require('fs'); var path = require('path');