mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Rules now get the Meteor root directory passed to them. They can use that information to extract further information about the file being linted based on its path in the project.
20 lines
498 B
JavaScript
20 lines
498 B
JavaScript
import path from 'path'
|
|
|
|
// must be require for rewire to work
|
|
var pathExists = require('path-exists')
|
|
|
|
export default function getMeteorProjectRootPath (currentDirectory) {
|
|
|
|
// No folder with '.meteor/release' in it found
|
|
if (currentDirectory === path.sep) {
|
|
return false
|
|
}
|
|
|
|
const meteorPath = path.join(currentDirectory, '.meteor', 'release')
|
|
if (pathExists.sync(meteorPath)) {
|
|
return currentDirectory
|
|
}
|
|
|
|
return getMeteorProjectRootPath(path.join(currentDirectory, '..'))
|
|
}
|