Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 16, 2020
1 parent 096036c commit 41133a9
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 30 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
@@ -1,6 +1,4 @@
os: osx
language: node_js
node_js:
- '12'
- '10'
- '8'
35 changes: 18 additions & 17 deletions index.d.ts
@@ -1,19 +1,20 @@
/**
* use typescript
* Fix the $PATH on macOS when run from a GUI app
* @example
* ```
* import fixPath from 'fix-path';
*
* console.log(process.env.PATH);
* //=> '/usr/bin'
*
* fixPath();
*
* console.log(process.env.PATH);
* //=> '/usr/local/bin:/usr/bin'
*
* ```
*/
Fix the `$PATH` on macOS when run from a GUI app.
export default function fixPath(): void;
Useful for Electron apps as GUI apps on macOS doesn't inherit the `$PATH` defined in your dotfiles *(.bashrc/.bash_profile/.zshrc/etc)*.
```
import fixPath = require('fix-path');
console.log(process.env.PATH);
//=> '/usr/bin'
fixPath();
console.log(process.env.PATH);
//=> '/usr/local/bin:/usr/bin'
```
*/
declare function fixPath(): void;

export = fixPath;
2 changes: 1 addition & 1 deletion index.test-d.ts
@@ -1,4 +1,4 @@
import {expectType} from 'tsd';
import fixPath from '.';
import fixPath = require('.');

expectType<void>(fixPath());
2 changes: 1 addition & 1 deletion license
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -4,13 +4,14 @@
"description": "Fix the $PATH on macOS when run from a GUI app",
"license": "MIT",
"repository": "sindresorhus/fix-path",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -33,12 +34,11 @@
"electron"
],
"dependencies": {
"shell-path": "^2.0.0"
"shell-path": "^2.1.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.11.0",
"xo": "^0.24.0"
},
"types": "index.d.ts"
"xo": "^0.26.1"
}
}
3 changes: 0 additions & 3 deletions readme.md
Expand Up @@ -4,14 +4,12 @@
Useful for Electron apps as GUI apps on macOS doesn't inherit the `$PATH` defined in your dotfiles *(.bashrc/.bash_profile/.zshrc/etc)*.


## Install

```
$ npm install fix-path
```


## Usage

```js
Expand All @@ -26,7 +24,6 @@ console.log(process.env.PATH);
//=> '/usr/local/bin:/usr/bin'
```


## Related

- [shell-path](https://github.com/sindresorhus/shell-path) - Get the `$PATH` from the shell
1 change: 1 addition & 0 deletions test.js
Expand Up @@ -3,5 +3,6 @@ import fixPath from '.';

test('main', t => {
fixPath();

t.true(process.env.PATH.includes('/usr/local'));
});

0 comments on commit 41133a9

Please sign in to comment.