|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
625 bytes
|
| Line | |
|---|
| 1 | /*!
|
|---|
| 2 | * global-modules <https://github.com/jonschlinkert/global-modules>
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright (c) 2015-2017 Jon Schlinkert.
|
|---|
| 5 | * Licensed under the MIT license.
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | 'use strict';
|
|---|
| 9 |
|
|---|
| 10 | const path = require('path');
|
|---|
| 11 | const prefix = require('global-prefix');
|
|---|
| 12 | let gm;
|
|---|
| 13 |
|
|---|
| 14 | function getPath() {
|
|---|
| 15 | if (process.platform === 'win32' || process.env.OSTYPE === 'msys' || process.env.OSTYPE === 'cygwin') {
|
|---|
| 16 | return path.resolve(prefix, 'node_modules');
|
|---|
| 17 | }
|
|---|
| 18 | return path.resolve(prefix, 'lib/node_modules');
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | /**
|
|---|
| 22 | * Expose `global-modules` path
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | Reflect.defineProperty(module, 'exports', {
|
|---|
| 26 | get() {
|
|---|
| 27 | return gm || (gm = getPath());
|
|---|
| 28 | }
|
|---|
| 29 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.