@sap/cli-core
Version:
Command-Line Interface (CLI) Core Module
11 lines (10 loc) • 450 B
JavaScript
import { homedir } from "os";
import path from "path";
import { getPackageName } from "../config/core.js";
import { removeScopeFromPackageName } from "../utils/utils.js";
export const getPath = (...args) => {
const rootPath = process.env.CLI_LEGACY_CACHE_LOCATION === "true"
? import.meta.dirname
: path.join(homedir(), ".@sap", removeScopeFromPackageName(getPackageName()));
return path.join(rootPath, ".cache", ...args);
};