|
1 |
| -'use strict'; |
2 |
| -const path = require('path'); |
3 |
| -const buildParserOptions = require('minimist-options'); |
4 |
| -const parseArguments = require('yargs-parser'); |
5 |
| -const camelCaseKeys = require('camelcase-keys'); |
6 |
| -const decamelize = require('decamelize'); |
7 |
| -const decamelizeKeys = require('decamelize-keys'); |
8 |
| -const trimNewlines = require('trim-newlines'); |
9 |
| -const redent = require('redent'); |
10 |
| -const readPkgUp = require('read-pkg-up'); |
11 |
| -const hardRejection = require('hard-rejection'); |
12 |
| -const normalizePackageData = require('normalize-package-data'); |
13 |
| - |
14 |
| -// Prevent caching of this module so module.parent is always accurate |
15 |
| -delete require.cache[__filename]; |
16 |
| -const parentDir = path.dirname(module.parent && module.parent.filename ? module.parent.filename : '.'); |
| 1 | +import buildParserOptions from 'minimist-options'; |
| 2 | +import parseArguments from 'yargs-parser'; |
| 3 | +import camelCaseKeys from 'camelcase-keys'; |
| 4 | +import decamelize from 'decamelize'; |
| 5 | +import decamelizeKeys from 'decamelize-keys'; |
| 6 | +import trimNewlines from 'trim-newlines'; |
| 7 | +import redent from 'redent'; |
| 8 | +import {readPackageUpSync} from 'read-pkg-up'; |
| 9 | +import hardRejection from 'hard-rejection'; |
| 10 | +import normalizePackageData from 'normalize-package-data'; |
17 | 11 |
|
18 | 12 | const isFlagMissing = (flagName, definedFlags, receivedFlags, input) => {
|
19 | 13 | const flag = definedFlags[flagName];
|
@@ -109,8 +103,7 @@ const meow = (helpText, options) => {
|
109 | 103 | helpText = '';
|
110 | 104 | }
|
111 | 105 |
|
112 |
| - const foundPkg = readPkgUp.sync({ |
113 |
| - cwd: parentDir, |
| 106 | + const foundPkg = readPackageUpSync({ |
114 | 107 | normalize: false
|
115 | 108 | });
|
116 | 109 |
|
@@ -231,4 +224,4 @@ const meow = (helpText, options) => {
|
231 | 224 | };
|
232 | 225 | };
|
233 | 226 |
|
234 |
| -module.exports = meow; |
| 227 | +export default meow; |
0 commit comments