You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Clears previously installed rule files associated with a specific NPM package before installing new ones.
257
262
- Determines the target directory based on `editorType` and `options`.
258
-
-**Behavior for Single-File Providers** (e.g., Windsurf, Claude Code, Codex):
259
-
- Reads the determined single target file (e.g., `.windsurfrules`, `CLAUDE.md`).
263
+
-**Fixed Bug (Latest)**: Now correctly handles single-file providers by ensuring only the parent directory is created, not the file itself as a directory. The `singleFileProviders` array has been updated to include all single-file providers: `WINDSURF`, `CLAUDE_CODE`, `GEMINI`, `CODEX`, `AMP`, `ZED`, `UNIFIED`.
264
+
-**Behavior for Single-File Providers** (e.g., Windsurf, Claude Code, Codex, AMP, ZED, Unified):
265
+
- For non-existing file paths: Creates only the parent directory using `fs.ensureDir(path.dirname(defaultPath))` instead of incorrectly creating the file path as a directory.
266
+
- Reads the determined single target file (e.g., `.windsurfrules`, `CLAUDE.md`, `AGENTS.md`, `AGENT.md`, `.rules`).
260
267
- Removes any XML-like blocks within the file where the tag name starts with the package prefix (e.g., finds and removes `<pkgName_rule1>...</pkgName_rule1>`, `<pkgName_anotherRule>...</pkgName_anotherRule>`).
261
268
- Writes the modified content back to the file.
262
269
- Does _not_ delete the file itself.
263
-
-**Behavior for Multi-File Providers** (e.g., Cursor, Clinerules):
270
+
-**Behavior for Multi-File Providers** (e.g., Cursor, Clinerules, VSCode):
271
+
- For non-existing directory paths: Creates the directory using `fs.ensureDir(defaultPath)`.
264
272
- Deletes files within the target directory whose names start with `${pkgName}_`.
273
+
- Handles cases where target paths don't exist gracefully.
265
274
266
275
#### Commands
267
276
@@ -288,11 +297,91 @@ It handles parsing of command-line arguments, options, and delegates the executi
288
297
-`install <editor> [packageName] [options]`
289
298
- Defines the CLI options and arguments for the install command.
290
299
- Delegates the action to `installCommandAction` from `src/commands/install.ts`.
- Clears previously installed rules for a given package and editor type.
374
-
-**Single-File Providers** (Windsurf, Claude Code, Codex): Uses regex to remove XML-like blocks matching `<pkgName_ruleName>...</pkgName_ruleName>` patterns from the target file.
375
-
-**Multi-File Providers** (Cursor, Clinerules): Deletes files starting with `${pkgName}_` in the target directory.
- Clears previously installed rule files associated with a specific NPM package before installing new ones.
463
+
- Determines the target directory based on `editorType` and `options`.
464
+
-**Fixed Bug (Latest)**: Now correctly handles single-file providers by ensuring only the parent directory is created, not the file itself as a directory. The `singleFileProviders` array has been updated to include all single-file providers: `WINDSURF`, `CLAUDE_CODE`, `GEMINI`, `CODEX`, `AMP`, `ZED`, `UNIFIED`.
465
+
-**Behavior for Single-File Providers** (e.g., Windsurf, Claude Code, Codex, AMP, ZED, Unified):
466
+
- For non-existing file paths: Creates only the parent directory using `fs.ensureDir(path.dirname(defaultPath))` instead of incorrectly creating the file path as a directory.
467
+
- Reads the determined single target file (e.g., `.windsurfrules`, `CLAUDE.md`, `AGENTS.md`, `AGENT.md`, `.rules`).
468
+
- Removes any XML-like blocks within the file where the tag name starts with the package prefix (e.g., finds and removes `<pkgName_rule1>...</pkgName_rule1>`, `<pkgName_anotherRule>...</pkgName_anotherRule>`).
469
+
- Writes the modified content back to the file.
470
+
- Does _not_ delete the file itself.
471
+
-**Behavior for Multi-File Providers** (e.g., Cursor, Clinerules, VSCode):
472
+
- For non-existing directory paths: Creates the directory using `fs.ensureDir(defaultPath)`.
473
+
- Deletes files within the target directory whose names start with `${pkgName}_`.
376
474
- Handles cases where target paths don't exist gracefully.
0 commit comments