@sap/cli-core 2023.12.0 → 2023.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cache/utils.js CHANGED
@@ -7,10 +7,11 @@ exports.getPath = void 0;
7
7
  const os_1 = require("os");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const core_1 = require("../config/core");
10
+ const utils_1 = require("../utils/utils");
10
11
  const getPath = (...args) => {
11
12
  const rootPath = process.env.CLI_LEGACY_CACHE_LOCATION === "true"
12
13
  ? __dirname
13
- : path_1.default.join((0, os_1.homedir)(), ".@sap", (0, core_1.getName)());
14
+ : path_1.default.join((0, os_1.homedir)(), ".@sap", (0, utils_1.removeScopeFromPackageName)((0, core_1.getPackageName)()));
14
15
  return path_1.default.join(rootPath, ".cache", ...args);
15
16
  };
16
17
  exports.getPath = getPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cli-core",
3
- "version": "2023.12.0",
3
+ "version": "2023.13.0",
4
4
  "description": "Command-Line Interface (CLI) Core Module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "SAP SE",
@@ -27,6 +27,6 @@
27
27
  "open": "8.4.2",
28
28
  "path": "0.12.7",
29
29
  "prompts": "2.4.2",
30
- "qs": "6.11.1"
30
+ "qs": "6.11.2"
31
31
  }
32
32
  }
package/utils/utils.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare const getName: (cwd?: string) => string;
10
10
  export declare const getPackageName: (cwd?: string) => string;
11
11
  export declare const getDescription: (cwd?: string) => string;
12
12
  export declare const getBin: (cwd?: string) => string;
13
+ export declare const removeScopeFromPackageName: (packageName: string) => string;
13
14
  export declare const parseTenant: (tenant: string) => string;
14
15
  export declare const getInfoFromTenant: (tenant: string, verbose: boolean, printOutput?: boolean) => {
15
16
  host: string;
package/utils/utils.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.openUrlInBrowser = exports.toConstantCase = exports.sha256 = exports.getInfoFromTenant = exports.parseTenant = exports.getBin = exports.getDescription = exports.getPackageName = exports.getName = exports.getVersion = exports.readPackageJson = exports.requireFile = exports.parseVersion = void 0;
29
+ exports.openUrlInBrowser = exports.toConstantCase = exports.sha256 = exports.getInfoFromTenant = exports.parseTenant = exports.removeScopeFromPackageName = exports.getBin = exports.getDescription = exports.getPackageName = exports.getName = exports.getVersion = exports.readPackageJson = exports.requireFile = exports.parseVersion = void 0;
30
30
  const crypto = __importStar(require("crypto"));
31
31
  const path_1 = __importDefault(require("path"));
32
32
  const lodash_1 = require("lodash");
@@ -94,6 +94,10 @@ const getBin = (cwd = "") => {
94
94
  return keys[0];
95
95
  };
96
96
  exports.getBin = getBin;
97
+ const removeScopeFromPackageName = (packageName) =>
98
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
99
+ packageName.split("/").pop();
100
+ exports.removeScopeFromPackageName = removeScopeFromPackageName;
97
101
  const removeProtocol = (tenant) => tenant.replace(REGEX_HTTPS, "");
98
102
  const parseTenant = (tenant) => {
99
103
  const t = REGEX_HTTPS.test(tenant) ? tenant : `https://${tenant}`;