File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type {Reporter} from '../../reporters/index.js';
4
4
import type { Manifest } from '../../types.js' ;
5
5
import type Config from '../../config.js' ;
6
6
import { MessageError } from '../../errors.js' ;
7
+ import { OSX_GLOBAL_PREFIX_DIRECTORY } from '../../constants.js' ;
7
8
import { registries } from '../../registries/index.js' ;
8
9
import NoopReporter from '../../reporters/base-reporter.js' ;
9
10
import buildSubCommands from './_build-sub-commands.js' ;
@@ -76,6 +77,8 @@ function getGlobalPrefix(config: Config, flags: Object): string {
76
77
return String ( config . getOption ( 'prefix' ) ) ;
77
78
} else if ( process . env . PREFIX ) {
78
79
return process . env . PREFIX ;
80
+ } else if ( process . platform === 'darwin' ) {
81
+ return OSX_GLOBAL_PREFIX_DIRECTORY ;
79
82
} else if ( process . platform === 'win32' ) {
80
83
if ( process . env . LOCALAPPDATA ) {
81
84
return path . join ( process . env . LOCALAPPDATA , 'Yarn' , 'bin' ) ;
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export const MODULE_CACHE_DIRECTORY = getCacheDirectory();
58
58
export const CONFIG_DIRECTORY = getDirectory ( 'config' ) ;
59
59
export const LINK_REGISTRY_DIRECTORY = path . join ( CONFIG_DIRECTORY , 'link' ) ;
60
60
export const GLOBAL_MODULE_DIRECTORY = path . join ( CONFIG_DIRECTORY , 'global' ) ;
61
+ export const OSX_GLOBAL_PREFIX_DIRECTORY = '/usr/local' ;
61
62
62
63
export const META_FOLDER = '.yarn-meta' ;
63
64
export const INTEGRITY_FILENAME = '.yarn-integrity' ;
You can’t perform that action at this time.
0 commit comments