From 41133a9fa65f58cb7013fb49c6c80cb5171c9ed3 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 17 Feb 2020 00:05:14 +0700 Subject: [PATCH] Require Node.js 10 --- .travis.yml | 2 -- index.d.ts | 35 ++++++++++++++++++----------------- index.test-d.ts | 2 +- license | 2 +- package.json | 12 ++++++------ readme.md | 3 --- test.js | 1 + 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d9d707..94ab01f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,4 @@ -os: osx language: node_js node_js: - '12' - '10' - - '8' diff --git a/index.d.ts b/index.d.ts index df8b928..9c6557f 100644 --- a/index.d.ts +++ b/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; \ No newline at end of file +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; diff --git a/index.test-d.ts b/index.test-d.ts index dbe17d3..4515d99 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,4 +1,4 @@ import {expectType} from 'tsd'; -import fixPath from '.'; +import fixPath = require('.'); expectType(fixPath()); diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/package.json b/package.json index 2dd20ff..8f2991c 100644 --- a/package.json +++ b/package.json @@ -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" @@ -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" + } } diff --git a/readme.md b/readme.md index 670e32a..84c086c 100644 --- a/readme.md +++ b/readme.md @@ -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 @@ -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 diff --git a/test.js b/test.js index 8384ea5..ab1ea49 100644 --- a/test.js +++ b/test.js @@ -3,5 +3,6 @@ import fixPath from '.'; test('main', t => { fixPath(); + t.true(process.env.PATH.includes('/usr/local')); });