common/scripts/install-run.js
function findRushJsonFolder() {
    if (!_rushJsonFolder) {
        let basePath = __dirname;
        let tempPath = __dirname;
        do {
            const testRushJsonPath = path.join(basePath, exports.RUSH_JSON_FILENAME);
            if (fs.existsSync(testRushJsonPath)) {
                _rushJsonFolder = basePath;
                break;
            }
            else {
                basePath = tempPath;
            }
        } while (basePath !== (tempPath = path.dirname(basePath))); // Exit the loop when we hit the disk root
        if (!_rushJsonFolder) {
            throw new Error('Unable to find rush.json.');
        }
    }
    return _rushJsonFolder;
}
function findRushJsonFolder() {
    if (!_rushJsonFolder) {
        let basePath = __dirname;
        let tempPath = __dirname;
        do {
            const testRushJsonPath = path.join(basePath, exports.RUSH_JSON_FILENAME);
            if (fs.existsSync(testRushJsonPath)) {
                _rushJsonFolder = basePath;
                break;
            }
            else {
                basePath = tempPath;
            }
        } while (basePath !== (tempPath = path.dirname(basePath))); // Exit the loop when we hit the disk root
        if (!_rushJsonFolder) {
            throw new Error('Unable to find rush.json.');
        }
    }
    return _rushJsonFolder;
}
function findRushJsonFolder ( ) { if ( ! _rushJsonFolder ) { let basePath = __dirname ; let tempPath = __dirname ; do { const testRushJsonPath = path . join ( basePath , exports . RUSH_JSON_FILENAME ) ; if ( fs . existsSync ( testRushJsonPath ) ) { _rushJsonFolder = basePath ; break ; } else { basePath = tempPath ; } } while ( basePath !== ( tempPath = path . dirname ( basePath ) ) ) ; // Exit the loop when we hit the disk root if ( ! _rushJsonFolder ) { throw new Error ( 'Unable to find rush.json.' ) ; } } return _rushJsonFolder ; }
Find the absolute path to the folder containing rush.json
Find the absolute path to the folder containing rush . json