File tree Expand file tree Collapse file tree 8 files changed +22
-29
lines changed
Expand file tree Collapse file tree 8 files changed +22
-29
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,12 +10,10 @@ jobs:
1010 fail-fast : false
1111 matrix :
1212 node-version :
13- - 14
14- - 12
15- - 10
13+ - 16
1614 steps :
1715 - uses : actions/checkout@v2
18- - uses : actions/setup-node@v1
16+ - uses : actions/setup-node@v2
1917 with :
2018 node-version : ${{ matrix.node-version }}
2119 - run : npm install
Original file line number Diff line number Diff line change 11/**
22Fix the `$PATH` on macOS when run from a GUI app.
33
4- Useful for Electron apps as GUI apps on macOS doesn't inherit the `$PATH` defined in your dotfiles *(.bashrc/.bash_profile/.zshrc/etc)*.
5-
64```
7- import fixPath = require( 'fix-path') ;
5+ import fixPath from 'fix-path';
86
97console.log(process.env.PATH);
108//=> '/usr/bin'
@@ -15,6 +13,4 @@ console.log(process.env.PATH);
1513//=> '/usr/local/bin:/usr/bin'
1614```
1715*/
18- declare function fixPath ( ) : void ;
19-
20- export = fixPath ;
16+ export default function fixPath ( ) : void ;
Original file line number Diff line number Diff line change 1- 'use strict ';
2- const shellPath = require ( 'shell-path' ) ;
1+ import process from 'node:process ';
2+ import { shellPathSync } from 'shell-path' ;
33
4- module . exports = ( ) => {
4+ export default function fixPath ( ) {
55 if ( process . platform !== 'darwin' ) {
66 return ;
77 }
88
9- process . env . PATH = shellPath . sync ( ) || [
9+ process . env . PATH = shellPathSync ( ) || [
1010 './node_modules/.bin' ,
1111 '/.nodebrew/current/bin' ,
1212 '/usr/local/bin' ,
13- process . env . PATH
13+ process . env . PATH ,
1414 ] . join ( ':' ) ;
15- } ;
15+ }
Original file line number Diff line number Diff line change 11import { expectType } from 'tsd' ;
2- import fixPath = require ( '.' ) ;
2+ import fixPath from './index.js' ;
33
44expectType < void > ( fixPath ( ) ) ;
Original file line number Diff line number Diff line change 1010 "email" : " sindresorhus@gmail.com" ,
1111 "url" : " https://sindresorhus.com"
1212 },
13+ "type" : " module" ,
14+ "exports" : " ./index.js" ,
1315 "engines" : {
14- "node" : " >=10 "
16+ "node" : " ^12.20.0 || ^14.13.1 || >=16.0.0 "
1517 },
1618 "scripts" : {
1719 "test" : " xo && ava && tsd"
2426 " fix" ,
2527 " path" ,
2628 " macos" ,
27- " osx" ,
2829 " env" ,
2930 " environment" ,
3031 " variable" ,
3435 " electron"
3536 ],
3637 "dependencies" : {
37- "shell-path" : " ^2.1 .0"
38+ "shell-path" : " ^3.0 .0"
3839 },
3940 "devDependencies" : {
40- "ava" : " ^1.4.1 " ,
41- "tsd" : " ^0.11 .0" ,
42- "xo" : " ^0.26.1 "
41+ "ava" : " ^3.15.0 " ,
42+ "tsd" : " ^0.17 .0" ,
43+ "xo" : " ^0.44.0 "
4344 }
4445}
Original file line number Diff line number Diff line change 22
33> Fix the ` $PATH ` on macOS when run from a GUI app
44
5- Useful for Electron apps as GUI apps on macOS doesn't inherit the ` $PATH ` defined in your dotfiles * (.bashrc/.bash_profile/.zshrc/etc)* .
5+ Useful for Electron apps as GUI apps on macOS do not inherit the ` $PATH ` defined in your dotfiles * (.bashrc/.bash_profile/.zshrc/etc)* .
66
77## Install
88
@@ -13,7 +13,7 @@ $ npm install fix-path
1313## Usage
1414
1515``` js
16- const fixPath = require ( ' fix-path' ) ;
16+ import fixPath from ' fix-path' ;
1717
1818console .log (process .env .PATH );
1919// => '/usr/bin'
Original file line number Diff line number Diff line change 1+ import process from 'node:process' ;
12import test from 'ava' ;
2- import fixPath from '.' ;
3+ import fixPath from './index.js ' ;
34
45test ( 'main' , t => {
56 fixPath ( ) ;
You can’t perform that action at this time.
0 commit comments