From 8343f3cdcfb1a04d3269e4e1d466f9f64026409b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 16 Aug 2017 10:06:20 +0300 Subject: [PATCH] Remove os.homedir() polyfill --- src/helper.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/helper.js b/src/helper.js index 127f0f38..93b968b6 100644 --- a/src/helper.js +++ b/src/helper.js @@ -116,17 +116,8 @@ function expandHome(shortenedPath) { if (!shortenedPath) { return ""; } - var home; - if (os.homedir) { - home = os.homedir(); - } - - if (!home) { - home = process.env.HOME || ""; - } - - home = home.replace("$", "$$$$"); + const home = os.homedir().replace("$", "$$$$"); return path.resolve(shortenedPath.replace(/^~($|\/|\\)/, home + "$1")); }