GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: //proc/thread-self/root/usr/local/lib/node_modules/firebase-tools/lib/detectProjectRoot.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectProjectRoot = void 0;
const fsutils_1 = require("./fsutils");
const error_1 = require("./error");
const path_1 = require("path");
function detectProjectRoot(options) {
    let projectRootDir = options.cwd || process.cwd();
    if (options.configPath) {
        const fullPath = (0, path_1.resolve)(projectRootDir, options.configPath);
        if (!(0, fsutils_1.fileExistsSync)(fullPath)) {
            throw new error_1.FirebaseError(`Could not load config file ${options.configPath}.`, {
                exit: 1,
                status: 404,
            });
        }
        return (0, path_1.dirname)(fullPath);
    }
    while (!(0, fsutils_1.fileExistsSync)((0, path_1.resolve)(projectRootDir, "./firebase.json"))) {
        const parentDir = (0, path_1.dirname)(projectRootDir);
        if (parentDir === projectRootDir) {
            return null;
        }
        projectRootDir = parentDir;
    }
    return projectRootDir;
}
exports.detectProjectRoot = detectProjectRoot;