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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-gitsync",
3
- "version": "2.11.3",
3
+ "version": "2.11.5",
4
4
  "description": "一个 git 提交的工具",
5
5
  "main": "index.js",
6
6
  "type": "module",
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
  };