first commit
This commit is contained in:
16
app_vue/node_modules/yorkie/src/utils/find-parent.js
generated
vendored
Normal file
16
app_vue/node_modules/yorkie/src/utils/find-parent.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = function findParent(currentDir, name) {
|
||||
const dirs = currentDir.split(path.sep)
|
||||
|
||||
while (dirs.pop()) {
|
||||
const dir = dirs.join(path.sep)
|
||||
|
||||
if (fs.existsSync(path.join(dir, name))) {
|
||||
return path.resolve(dir)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user