HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/web.enelar.com.co/node_modules/nx/src/utils/cache-directory.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.projectGraphCacheDirectory = exports.cacheDirectoryForWorkspace = exports.cacheDir = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
const fileutils_1 = require("./fileutils");
const workspace_root_1 = require("./workspace-root");
function readCacheDirectoryProperty(root) {
    try {
        const nxJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(root, 'nx.json'));
        return (nxJson.cacheDirectory ??
            nxJson.tasksRunnerOptions?.default.options.cacheDirectory);
    }
    catch {
        return undefined;
    }
}
function absolutePath(root, path) {
    if ((0, path_1.isAbsolute)(path)) {
        return path;
    }
    else {
        return (0, path_1.join)(root, path);
    }
}
function cacheDirectory(root, cacheDirectory) {
    const cacheDirFromEnv = process.env.NX_CACHE_DIRECTORY;
    if (cacheDirFromEnv) {
        cacheDirectory = cacheDirFromEnv;
    }
    if (cacheDirectory) {
        return absolutePath(root, cacheDirectory);
    }
    else {
        return defaultCacheDirectory(root);
    }
}
function defaultCacheDirectory(root) {
    // If nx.json doesn't exist the repo can't utilize
    // caching, so .nx/cache is less relevant. Lerna users
    // that don't want to fully opt in to Nx at this time
    // may also be caught off guard by the appearance of
    // a .nx directory, so we are going to special case
    // this for the time being.
    if ((0, fs_1.existsSync)((0, path_1.join)(root, 'lerna.json')) &&
        !(0, fs_1.existsSync)((0, path_1.join)(root, 'nx.json'))) {
        return (0, path_1.join)(root, 'node_modules', '.cache', 'nx');
    }
    return (0, path_1.join)(root, '.nx', 'cache');
}
/**
 * Path to the directory where Nx stores its cache and daemon-related files.
 */
exports.cacheDir = cacheDirectory(workspace_root_1.workspaceRoot, readCacheDirectoryProperty(workspace_root_1.workspaceRoot));
function cacheDirectoryForWorkspace(workspaceRoot) {
    return cacheDirectory(workspaceRoot, readCacheDirectoryProperty(workspaceRoot));
}
exports.cacheDirectoryForWorkspace = cacheDirectoryForWorkspace;
exports.projectGraphCacheDirectory = absolutePath(workspace_root_1.workspaceRoot, process.env.NX_PROJECT_GRAPH_CACHE_DIRECTORY ??
    defaultCacheDirectory(workspace_root_1.workspaceRoot));