Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
096036c
commit 41133a9
Showing
7 changed files
with
27 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
os: osx | ||
language: node_js | ||
node_js: | ||
- '12' | ||
- '10' | ||
- '8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {expectType} from 'tsd'; | ||
import fixPath from '.'; | ||
import fixPath = require('.'); | ||
|
||
expectType<void>(fixPath()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ import fixPath from '.'; | |
|
||
test('main', t => { | ||
fixPath(); | ||
|
||
t.true(process.env.PATH.includes('/usr/local')); | ||
}); |