From f4fe7431ed992862a1c1d2357e6521c268bad7a7 Mon Sep 17 00:00:00 2001 From: Lucas Katayama Date: Mon, 31 Oct 2016 00:58:12 -0200 Subject: [PATCH] Fixing global add in linux root folder #1029 (#1344) * Fixing global add in linux root folder #1029 * Changing global path to /usr/local/share --- src/constants.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/constants.js b/src/constants.js index 07499ccf04..286289453a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,9 +1,13 @@ /* @flow */ - -const userHome = require('user-home'); const path = require('path'); +let userHome = require('user-home'); +if (process.platform === 'linux' && process.env.USER === 'root') { + userHome = path.resolve('/usr/local/share'); +} -type Env = {[key: string]: ?string}; +type Env = { + [key: string]: ? string +}; export const DEPENDENCY_TYPES = [ 'devDependencies',