@catladder/cli 0.0.0-main-c0845351 → 0.0.0-main-cd350966
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/dist/bundles/catenv/index.js +9 -15
- package/dist/bundles/cli/index.js +9 -15
- package/dist/cli/src/utils/files.js +2 -5
- package/dist/cli/src/utils/files.js.map +1 -1
- package/dist/cli/src/utils/preferences/index.js +5 -8
- package/dist/cli/src/utils/preferences/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/utils/files.ts +2 -3
- package/src/utils/preferences/index.ts +8 -6
|
@@ -403,17 +403,14 @@ exports.parseChoice = parseChoice;
|
|
|
403
403
|
/***/ }),
|
|
404
404
|
|
|
405
405
|
/***/ 9863:
|
|
406
|
-
/***/ (
|
|
406
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
407
407
|
|
|
408
408
|
"use strict";
|
|
409
409
|
|
|
410
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
411
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
412
|
-
};
|
|
413
410
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
414
411
|
exports.readFileOrError = void 0;
|
|
415
|
-
const fs_extra_1 =
|
|
416
|
-
const readFile =
|
|
412
|
+
const fs_extra_1 = __nccwpck_require__(5501);
|
|
413
|
+
const readFile = (file) => (0, fs_extra_1.readFile)(file, { encoding: "utf-8" });
|
|
417
414
|
const readFileOrError = async (filePath) => {
|
|
418
415
|
try {
|
|
419
416
|
const file = await readFile(filePath);
|
|
@@ -642,26 +639,23 @@ exports.upsertAllVariables = upsertAllVariables;
|
|
|
642
639
|
/***/ }),
|
|
643
640
|
|
|
644
641
|
/***/ 2636:
|
|
645
|
-
/***/ (
|
|
642
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
646
643
|
|
|
647
644
|
"use strict";
|
|
648
645
|
|
|
649
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
650
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
651
|
-
};
|
|
652
646
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
653
647
|
exports.setPreference = exports.getPreference = exports.hasPreference = void 0;
|
|
654
|
-
const fs_extra_1 =
|
|
648
|
+
const fs_extra_1 = __nccwpck_require__(5501);
|
|
655
649
|
const os_1 = __nccwpck_require__(2037);
|
|
656
650
|
const yaml_1 = __nccwpck_require__(8033);
|
|
657
651
|
const directory = `${(0, os_1.homedir)()}/.catladder`;
|
|
658
652
|
const file = `${directory}/preferences.yml`;
|
|
659
653
|
const getPreferences = async () => {
|
|
660
654
|
var _a;
|
|
661
|
-
if (!(await fs_extra_1.
|
|
662
|
-
await fs_extra_1.
|
|
655
|
+
if (!(await (0, fs_extra_1.pathExists)(file))) {
|
|
656
|
+
await (0, fs_extra_1.createFile)(file);
|
|
663
657
|
}
|
|
664
|
-
return ((_a = (0, yaml_1.parse)(await fs_extra_1.
|
|
658
|
+
return ((_a = (0, yaml_1.parse)(await (0, fs_extra_1.readFile)(file, { encoding: "utf-8" }))) !== null && _a !== void 0 ? _a : {});
|
|
665
659
|
};
|
|
666
660
|
const hasPreference = async (key) => {
|
|
667
661
|
const preferences = await getPreferences();
|
|
@@ -679,7 +673,7 @@ const setPreference = async (key, value) => {
|
|
|
679
673
|
...preferences,
|
|
680
674
|
[key]: value,
|
|
681
675
|
};
|
|
682
|
-
await fs_extra_1.
|
|
676
|
+
await (0, fs_extra_1.writeFile)(file, (0, yaml_1.stringify)(newPreferences));
|
|
683
677
|
};
|
|
684
678
|
exports.setPreference = setPreference;
|
|
685
679
|
//# sourceMappingURL=index.js.map
|
|
@@ -3293,17 +3293,14 @@ exports.editAsFile = editAsFile;
|
|
|
3293
3293
|
/***/ }),
|
|
3294
3294
|
|
|
3295
3295
|
/***/ 9863:
|
|
3296
|
-
/***/ (
|
|
3296
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3297
3297
|
|
|
3298
3298
|
"use strict";
|
|
3299
3299
|
|
|
3300
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3301
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3302
|
-
};
|
|
3303
3300
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3304
3301
|
exports.readFileOrError = void 0;
|
|
3305
|
-
const fs_extra_1 =
|
|
3306
|
-
const readFile =
|
|
3302
|
+
const fs_extra_1 = __nccwpck_require__(85501);
|
|
3303
|
+
const readFile = (file) => (0, fs_extra_1.readFile)(file, { encoding: "utf-8" });
|
|
3307
3304
|
const readFileOrError = async (filePath) => {
|
|
3308
3305
|
try {
|
|
3309
3306
|
const file = await readFile(filePath);
|
|
@@ -3636,26 +3633,23 @@ exports.stopAllPortForwards = stopAllPortForwards;
|
|
|
3636
3633
|
/***/ }),
|
|
3637
3634
|
|
|
3638
3635
|
/***/ 62636:
|
|
3639
|
-
/***/ (
|
|
3636
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
3640
3637
|
|
|
3641
3638
|
"use strict";
|
|
3642
3639
|
|
|
3643
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3644
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3645
|
-
};
|
|
3646
3640
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3647
3641
|
exports.setPreference = exports.getPreference = exports.hasPreference = void 0;
|
|
3648
|
-
const fs_extra_1 =
|
|
3642
|
+
const fs_extra_1 = __nccwpck_require__(85501);
|
|
3649
3643
|
const os_1 = __nccwpck_require__(22037);
|
|
3650
3644
|
const yaml_1 = __nccwpck_require__(68033);
|
|
3651
3645
|
const directory = `${(0, os_1.homedir)()}/.catladder`;
|
|
3652
3646
|
const file = `${directory}/preferences.yml`;
|
|
3653
3647
|
const getPreferences = async () => {
|
|
3654
3648
|
var _a;
|
|
3655
|
-
if (!(await fs_extra_1.
|
|
3656
|
-
await fs_extra_1.
|
|
3649
|
+
if (!(await (0, fs_extra_1.pathExists)(file))) {
|
|
3650
|
+
await (0, fs_extra_1.createFile)(file);
|
|
3657
3651
|
}
|
|
3658
|
-
return ((_a = (0, yaml_1.parse)(await fs_extra_1.
|
|
3652
|
+
return ((_a = (0, yaml_1.parse)(await (0, fs_extra_1.readFile)(file, { encoding: "utf-8" }))) !== null && _a !== void 0 ? _a : {});
|
|
3659
3653
|
};
|
|
3660
3654
|
const hasPreference = async (key) => {
|
|
3661
3655
|
const preferences = await getPreferences();
|
|
@@ -3673,7 +3667,7 @@ const setPreference = async (key, value) => {
|
|
|
3673
3667
|
...preferences,
|
|
3674
3668
|
[key]: value,
|
|
3675
3669
|
};
|
|
3676
|
-
await fs_extra_1.
|
|
3670
|
+
await (0, fs_extra_1.writeFile)(file, (0, yaml_1.stringify)(newPreferences));
|
|
3677
3671
|
};
|
|
3678
3672
|
exports.setPreference = setPreference;
|
|
3679
3673
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.readFileOrError = void 0;
|
|
7
|
-
const fs_extra_1 =
|
|
8
|
-
const readFile =
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
5
|
+
const readFile = (file) => (0, fs_extra_1.readFile)(file, { encoding: "utf-8" });
|
|
9
6
|
const readFileOrError = async (filePath) => {
|
|
10
7
|
try {
|
|
11
8
|
const file = await readFile(filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../src/utils/files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../src/utils/files.ts"],"names":[],"mappings":";;;AAAA,uCAAuD;AAEvD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,mBAAe,EAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAEzE,MAAM,eAAe,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.setPreference = exports.getPreference = exports.hasPreference = void 0;
|
|
7
|
-
const fs_extra_1 =
|
|
4
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
5
|
const os_1 = require("os");
|
|
9
6
|
const yaml_1 = require("yaml");
|
|
10
7
|
const directory = `${(0, os_1.homedir)()}/.catladder`;
|
|
11
8
|
const file = `${directory}/preferences.yml`;
|
|
12
9
|
const getPreferences = async () => {
|
|
13
10
|
var _a;
|
|
14
|
-
if (!(await fs_extra_1.
|
|
15
|
-
await fs_extra_1.
|
|
11
|
+
if (!(await (0, fs_extra_1.pathExists)(file))) {
|
|
12
|
+
await (0, fs_extra_1.createFile)(file);
|
|
16
13
|
}
|
|
17
|
-
return ((_a = (0, yaml_1.parse)(await fs_extra_1.
|
|
14
|
+
return ((_a = (0, yaml_1.parse)(await (0, fs_extra_1.readFile)(file, { encoding: "utf-8" }))) !== null && _a !== void 0 ? _a : {});
|
|
18
15
|
};
|
|
19
16
|
const hasPreference = async (key) => {
|
|
20
17
|
const preferences = await getPreferences();
|
|
@@ -32,7 +29,7 @@ const setPreference = async (key, value) => {
|
|
|
32
29
|
...preferences,
|
|
33
30
|
[key]: value,
|
|
34
31
|
};
|
|
35
|
-
await fs_extra_1.
|
|
32
|
+
await (0, fs_extra_1.writeFile)(file, (0, yaml_1.stringify)(newPreferences));
|
|
36
33
|
};
|
|
37
34
|
exports.setPreference = setPreference;
|
|
38
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/preferences/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/preferences/index.ts"],"names":[],"mappings":";;;AAAA,uCAAuE;AACvE,2BAA6B;AAE7B,+BAAwC;AACxC,MAAM,SAAS,GAAG,GAAG,IAAA,YAAO,GAAE,aAAa,CAAC;AAC5C,MAAM,IAAI,GAAG,GAAG,SAAS,kBAAkB,CAAC;AAE5C,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;;IAChC,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,CAAC,MAAA,IAAA,YAAK,EAAC,MAAM,IAAA,mBAAQ,EAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,mCAAI,EAAE,CAG/D,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,aAAa,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;IACjD,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,OAAO,GAAG,IAAI,WAAW,CAAC;AAC5B,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;AACK,MAAM,aAAa,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;IACjD,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB;AAEK,MAAM,aAAa,GAAG,KAAK,EAAE,GAAW,EAAE,KAAsB,EAAE,EAAE;IACzE,MAAM,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;IAE3C,MAAM,cAAc,GAAG;QACrB,GAAG,WAAW;QACd,CAAC,GAAG,CAAC,EAAE,KAAK;KACb,CAAC;IAEF,MAAM,IAAA,oBAAS,EAAC,IAAI,EAAE,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB"}
|