Skip to content

Commit

Permalink
undo
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Aug 17, 2024
1 parent c9e1f17 commit 8a6d653
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 26 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ jobs:
fail-fast: false
matrix:
node: [16, 18, 20, 22]
os: [ubuntu-latest, windows-latest, macos-latest]
os:
- ubuntu-latest
# Windows tests are currently broken
# - windows-latest
- macos-latest

steps:
- name: Clone repository
Expand Down
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# global-prefix [![NPM version](https://img.shields.io/npm/v/global-prefix.svg?style=flat)](https://www.npmjs.com/package/global-prefix) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![NPM total downloads](https://img.shields.io/npm/dt/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/global-prefix.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/global-prefix) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/global-prefix.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/global-prefix)
# global-prefix [![NPM version](https://img.shields.io/npm/v/global-prefix.svg?style=flat)](https://www.npmjs.com/package/global-prefix) [![NPM monthly downloads](https://img.shields.io/npm/dm/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![NPM total downloads](https://img.shields.io/npm/dt/global-prefix.svg?style=flat)](https://npmjs.org/package/global-prefix) [![CI Status](https://img.shields.io/github/actions/workflow/status/jonschlinkert/global-prefix/ci.yml)](https://github.com/jonschlinkert/global-prefix/actions)

> Get the npm global path prefix.
Expand Down
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ const getPrefix = () => {

// Otherwise find the path of npm
let npm = tryNpmPath();
console.log(npm);
if (npm) {
// Check the built-in npm config file
prefix = tryConfigPath(path.resolve(npm, '..', '..', 'npmrc'));
console.log(prefix);

if (prefix) {
// Now the global npm config can also be checked.
Expand Down Expand Up @@ -66,9 +64,7 @@ const getPrefix = () => {

function tryNpmPath() {
try {
const npm = require('which').sync('npm');
console.log(npm);
return fs.realpathSync.native(npm);
return fs.realpathSync(require('which').sync('npm'));
} catch (err) { /* do nothing */ }
}

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"main": "index.js",
"engines": {
"node": ">=6"
"node": ">=16"
},
"scripts": {
"test": "mocha"
Expand All @@ -35,7 +35,6 @@
"which": "^4.0.0"
},
"devDependencies": {
"gulp-format-md": "^2.0.0",
"mocha": "^10.7.3"
},
"keywords": [
Expand Down
3 changes: 0 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const path = require('path');
const assert = require('assert');
const prefix = require('./');

const { execSync } = require("child_process");

describe('prefix', () => {
it('should resolve the path to the windows global prefix', () => {
if (process.platform === 'win32') {
Expand All @@ -23,7 +21,6 @@ describe('prefix', () => {
});

it('should resolve the path to the global prefix', () => {
console.log(execSync("npm prefix --global").toString('utf8'));
assert(fs.existsSync(prefix));
});
});

0 comments on commit 8a6d653

Please sign in to comment.