mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-17 07:43:38 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
24
node_modules/find-root/index.js
generated
vendored
Normal file
24
node_modules/find-root/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var path = require('path')
|
||||
var fs = require('fs')
|
||||
|
||||
function findRoot(start) {
|
||||
start = start || module.parent.filename
|
||||
if (typeof start === 'string') {
|
||||
if (start[start.length-1] !== path.sep) {
|
||||
start+=path.sep
|
||||
}
|
||||
start = start.split(path.sep)
|
||||
}
|
||||
if(!start.length) {
|
||||
throw new Error('package.json not found in path')
|
||||
}
|
||||
start.pop()
|
||||
var dir = start.join(path.sep)
|
||||
try {
|
||||
fs.statSync(path.join(dir, 'package.json'));
|
||||
return dir;
|
||||
} catch (e) {}
|
||||
return findRoot(start)
|
||||
}
|
||||
|
||||
module.exports = findRoot
|
||||
Reference in New Issue
Block a user