File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -145,17 +145,24 @@ const globalLibvipsVersion = () => {
145145 }
146146} ;
147147
148+ const getBrewPkgConfigPath = ( ) => {
149+ try {
150+ const brewPrefix = ( spawnSync ( 'brew' , [ '--prefix' ] , { encoding : 'utf8' } ) . stdout || '' ) . trim ( ) ;
151+ if ( brewPrefix ) {
152+ return `${ brewPrefix } /lib/pkgconfig` ;
153+ }
154+ } catch ( _err ) {
155+ // ignore
156+ }
157+ return undefined ;
158+ } ;
159+
148160/* node:coverage enable */
149161
150162const pkgConfigPath = ( ) => {
151163 if ( process . platform !== 'win32' ) {
152- /* node:coverage ignore next 4 */
153- const brewPkgConfigPath = spawnSync (
154- 'which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2' ,
155- spawnSyncOptions
156- ) . stdout || '' ;
157164 return [
158- brewPkgConfigPath . trim ( ) ,
165+ getBrewPkgConfigPath ( ) ,
159166 process . env . PKG_CONFIG_PATH ,
160167 '/usr/local/lib/pkgconfig' ,
161168 '/usr/lib/pkgconfig' ,
You can’t perform that action at this time.
0 commit comments