mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
Convert docs to docsy
This commit is contained in:
21
site/node_modules/cosmiconfig/lib/loadPackageProp.js
generated
vendored
Normal file
21
site/node_modules/cosmiconfig/lib/loadPackageProp.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var readFile = require('./readFile');
|
||||
var parseJson = require('./parseJson');
|
||||
|
||||
module.exports = function (packageDir, options) {
|
||||
var packagePath = path.join(packageDir, 'package.json');
|
||||
|
||||
return readFile(packagePath).then(function (content) {
|
||||
if (!content) return null;
|
||||
var parsedContent = parseJson(content, packagePath);
|
||||
var packagePropValue = parsedContent[options.packageProp];
|
||||
if (!packagePropValue) return null;
|
||||
|
||||
return {
|
||||
config: packagePropValue,
|
||||
filepath: packagePath,
|
||||
};
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user