zen-gitsync 2.11.3 → 2.11.5
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 +14 -0
- package/src/ui/public/assets/index-CSKtZnXM.css +1 -0
- package/src/ui/public/assets/index-CT2BP0M3.js +108 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/routes/config.js +14 -0
- package/src/ui/server/routes/fs.js +51 -1
- package/src/ui/public/assets/index-B0KjkiTF.js +0 -108
- package/src/ui/public/assets/index-vy-kFr2X.css +0 -1
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -260,6 +260,19 @@ async function saveRecentDirectory(dirPath) {
|
|
|
260
260
|
return list;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
async function removeRecentDirectory(dirPath) {
|
|
264
|
+
if (!dirPath || typeof dirPath !== 'string') return;
|
|
265
|
+
const state = await safeLoadRaw();
|
|
266
|
+
if (!state.ok) return [];
|
|
267
|
+
const raw = state.obj;
|
|
268
|
+
let list = Array.isArray(raw.recentDirectories) ? raw.recentDirectories.slice() : [];
|
|
269
|
+
const normalized = normalizeProjectPath(dirPath);
|
|
270
|
+
list = list.filter(p => normalizeProjectPath(p) !== normalized);
|
|
271
|
+
raw.recentDirectories = list;
|
|
272
|
+
await writeRawConfigFile(raw);
|
|
273
|
+
return list;
|
|
274
|
+
}
|
|
275
|
+
|
|
263
276
|
// 添加配置管理函数
|
|
264
277
|
async function handleConfigCommands() {
|
|
265
278
|
if (process.argv.includes('get-config')) {
|
|
@@ -290,6 +303,7 @@ export default {
|
|
|
290
303
|
getLockedFiles,
|
|
291
304
|
getRecentDirectories,
|
|
292
305
|
saveRecentDirectory,
|
|
306
|
+
removeRecentDirectory,
|
|
293
307
|
readRawConfigFile,
|
|
294
308
|
writeRawConfigFile
|
|
295
309
|
};
|