mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
Convert docs to docsy
This commit is contained in:
20
site/node_modules/cosmiconfig/lib/readFile.js
generated
vendored
Normal file
20
site/node_modules/cosmiconfig/lib/readFile.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
module.exports = function (filepath, options) {
|
||||
options = options || {};
|
||||
options.throwNotFound = options.throwNotFound || false;
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
fs.readFile(filepath, 'utf8', function (err, content) {
|
||||
if (err && err.code === 'ENOENT' && !options.throwNotFound) {
|
||||
return resolve(null);
|
||||
}
|
||||
|
||||
if (err) return reject(err);
|
||||
|
||||
resolve(content);
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user