UNPKG

@sap/cli-core

Version:

Command-Line Interface (CLI) Core Module

18 lines (17 loc) 748 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPath = void 0; const os_1 = require("os"); const path_1 = __importDefault(require("path")); const core_1 = require("../config/core"); const utils_1 = require("../utils/utils"); const getPath = (...args) => { const rootPath = process.env.CLI_LEGACY_CACHE_LOCATION === "true" ? __dirname : path_1.default.join((0, os_1.homedir)(), ".@sap", (0, utils_1.removeScopeFromPackageName)((0, core_1.getPackageName)())); return path_1.default.join(rootPath, ".cache", ...args); }; exports.getPath = getPath;