@opscompass/opscompass-cli 1.0.45 → 1.0.46

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.
Files changed (2) hide show
  1. package/index.js +12 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -10,6 +10,18 @@ const path = require("path");
10
10
 
11
11
  let defaultParams = JSON.parse("{}");
12
12
 
13
+ // Make sure opscompassHome exists
14
+ try {
15
+ if (!fs.existsSync(opscompassHome)) {
16
+ fs.mkdirSync(opscompassHome, { recursive: true });
17
+ }
18
+ } catch (error) {
19
+ console.error(
20
+ `Error: Unable to create Opscompass home directory at ${opscompassHome}: ${error.message}`
21
+ );
22
+ process.exit(1);
23
+ }
24
+
13
25
  // If an offline file exists in ~/.opscompass, set the flag to true
14
26
  let isOffline = false;
15
27
  const offlinePath = path.join(opscompassHome, ".offline");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opscompass/opscompass-cli",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "Calls OpsCompass's APIs",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "author": "opscompass",
17
17
  "license": "SEE LICENSE IN license.txt",
18
18
  "dependencies": {
19
- "@opscompass/opscompass-api": "^1.0.45",
19
+ "@opscompass/opscompass-api": "^1.0.46",
20
20
  "adm-zip": "^0.5.16",
21
21
  "axios": "^0.28.1",
22
22
  "better-sqlite3": "^11.8.0",