@catladder/cli 0.0.0-main-4b12a1b7 → 0.0.0-main-9a68e57b
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.
|
@@ -726,23 +726,19 @@ const yaml_1 = __nccwpck_require__(8033);
|
|
|
726
726
|
const legacyPreferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".catladder/preferences.yml");
|
|
727
727
|
const preferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".config/catladder/preferences.yml");
|
|
728
728
|
const ensurePreferencesFile = async () => {
|
|
729
|
-
if ((0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
730
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
731
|
-
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
732
|
-
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
733
|
-
await (0, promises_1.rename)(legacyPreferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
734
|
-
await (0, promises_1.chmod)((0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"), 0o600);
|
|
735
|
-
await (0, promises_1.rmdir)((0, path_1.dirname)(legacyPreferencesPath));
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
729
|
if ((0, fs_1.existsSync)(preferencesPath)) {
|
|
739
730
|
return;
|
|
740
731
|
}
|
|
741
732
|
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
733
|
+
if (!(0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
734
|
+
return (0, promises_1.writeFile)(preferencesPath, "---\n{}", {
|
|
735
|
+
encoding: "utf-8",
|
|
736
|
+
mode: 0o600,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
740
|
+
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
741
|
+
await (0, promises_1.cp)(preferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
746
742
|
};
|
|
747
743
|
const loadPreferences = async () => {
|
|
748
744
|
await ensurePreferencesFile();
|
|
@@ -3613,23 +3613,19 @@ const yaml_1 = __nccwpck_require__(68033);
|
|
|
3613
3613
|
const legacyPreferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".catladder/preferences.yml");
|
|
3614
3614
|
const preferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".config/catladder/preferences.yml");
|
|
3615
3615
|
const ensurePreferencesFile = async () => {
|
|
3616
|
-
if ((0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
3617
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
3618
|
-
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
3619
|
-
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
3620
|
-
await (0, promises_1.rename)(legacyPreferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
3621
|
-
await (0, promises_1.chmod)((0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"), 0o600);
|
|
3622
|
-
await (0, promises_1.rmdir)((0, path_1.dirname)(legacyPreferencesPath));
|
|
3623
|
-
return;
|
|
3624
|
-
}
|
|
3625
3616
|
if ((0, fs_1.existsSync)(preferencesPath)) {
|
|
3626
3617
|
return;
|
|
3627
3618
|
}
|
|
3628
3619
|
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3620
|
+
if (!(0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
3621
|
+
return (0, promises_1.writeFile)(preferencesPath, "---\n{}", {
|
|
3622
|
+
encoding: "utf-8",
|
|
3623
|
+
mode: 0o600,
|
|
3624
|
+
});
|
|
3625
|
+
}
|
|
3626
|
+
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
3627
|
+
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
3628
|
+
await (0, promises_1.cp)(preferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
3633
3629
|
};
|
|
3634
3630
|
const loadPreferences = async () => {
|
|
3635
3631
|
await ensurePreferencesFile();
|
|
@@ -9,23 +9,19 @@ const yaml_1 = require("yaml");
|
|
|
9
9
|
const legacyPreferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".catladder/preferences.yml");
|
|
10
10
|
const preferencesPath = (0, path_1.join)((0, os_1.homedir)(), ".config/catladder/preferences.yml");
|
|
11
11
|
const ensurePreferencesFile = async () => {
|
|
12
|
-
if ((0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
13
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
14
|
-
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
15
|
-
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
16
|
-
await (0, promises_1.rename)(legacyPreferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
17
|
-
await (0, promises_1.chmod)((0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"), 0o600);
|
|
18
|
-
await (0, promises_1.rmdir)((0, path_1.dirname)(legacyPreferencesPath));
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
12
|
if ((0, fs_1.existsSync)(preferencesPath)) {
|
|
22
13
|
return;
|
|
23
14
|
}
|
|
24
15
|
await (0, promises_1.mkdir)((0, path_1.dirname)(preferencesPath), { recursive: true, mode: 0o700 });
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
if (!(0, fs_1.existsSync)(legacyPreferencesPath)) {
|
|
17
|
+
return (0, promises_1.writeFile)(preferencesPath, "---\n{}", {
|
|
18
|
+
encoding: "utf-8",
|
|
19
|
+
mode: 0o600,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
await (0, promises_1.cp)(legacyPreferencesPath, preferencesPath);
|
|
23
|
+
await (0, promises_1.chmod)(preferencesPath, 0o600);
|
|
24
|
+
await (0, promises_1.cp)(preferencesPath, (0, path_1.join)((0, path_1.dirname)(preferencesPath), "old_preferences_backup.yml"));
|
|
29
25
|
};
|
|
30
26
|
const loadPreferences = async () => {
|
|
31
27
|
await ensurePreferencesFile();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../../src/utils/preferences.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../../src/utils/preferences.ts"],"names":[],"mappings":";;;AAAA,0CAAoE;AACpE,2BAAgC;AAChC,+BAAqC;AACrC,2BAA6B;AAC7B,+BAAwC;AAExC,MAAM,qBAAqB,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,4BAA4B,CAAC,CAAC;AAC5E,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,mCAAmC,CAAC,CAAC;AAE7E,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACvC,IAAI,IAAA,eAAU,EAAC,eAAe,CAAC,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IACD,MAAM,IAAA,gBAAK,EAAC,IAAA,cAAO,EAAC,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,IAAA,eAAU,EAAC,qBAAqB,CAAC,EAAE,CAAC;QACvC,OAAO,I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