soulsync 1.2.0 → 1.2.2
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/package.json +1 -1
- package/src/config.js +10 -0
- package/src/sync-engine.js +2 -2
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -17,6 +17,12 @@ function loadConfig() {
|
|
|
17
17
|
try {
|
|
18
18
|
if (fs.existsSync(configPath)) {
|
|
19
19
|
config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
20
|
+
if (!config.cloud_url && config.server_url) {
|
|
21
|
+
config.cloud_url = config.server_url;
|
|
22
|
+
}
|
|
23
|
+
if (!config.cloud_url) {
|
|
24
|
+
config.cloud_url = 'https://soulsync.work';
|
|
25
|
+
}
|
|
20
26
|
return config;
|
|
21
27
|
}
|
|
22
28
|
} catch (e) {
|
|
@@ -34,6 +40,10 @@ function saveConfig(newConfig) {
|
|
|
34
40
|
if (fs.existsSync(configPath)) {
|
|
35
41
|
existing = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
36
42
|
}
|
|
43
|
+
if (newConfig.server_url && !newConfig.cloud_url) {
|
|
44
|
+
newConfig.cloud_url = newConfig.server_url;
|
|
45
|
+
delete newConfig.server_url;
|
|
46
|
+
}
|
|
37
47
|
config = { ...existing, ...newConfig };
|
|
38
48
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
39
49
|
return true;
|
package/src/sync-engine.js
CHANGED
|
@@ -599,8 +599,8 @@ class SyncEngine extends EventEmitter {
|
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
this.watcher = chokidar.watch(this.profilesDir, {
|
|
602
|
-
ignored: (
|
|
603
|
-
const basename = path.basename(
|
|
602
|
+
ignored: (filePath) => {
|
|
603
|
+
const basename = path.basename(filePath);
|
|
604
604
|
return this.isBackupFile(basename) || basename.includes('.conflict.');
|
|
605
605
|
},
|
|
606
606
|
persistent: true,
|