mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-21 21:44:46 +00:00
.
This commit is contained in:
parent
beb1329f9f
commit
2b95e76931
7736 changed files with 1874747 additions and 51184 deletions
22
node_modules/cosmiconfig/dist/getDirectory.js
generated
vendored
Normal file
22
node_modules/cosmiconfig/dist/getDirectory.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const isDirectory = require('is-directory');
|
||||
|
||||
function getDirectory(filepath ) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return isDirectory(filepath, (err, filepathIsDirectory) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
return resolve(filepathIsDirectory ? filepath : path.dirname(filepath));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getDirectory.sync = function getDirectorySync(filepath ) {
|
||||
return isDirectory.sync(filepath) ? filepath : path.dirname(filepath);
|
||||
};
|
||||
|
||||
module.exports = getDirectory;
|
Loading…
Add table
Add a link
Reference in a new issue