Create .clinerules directory when adding new cline rule in ui and .clinerules is currently a file (#3217)

* create clinerules dir

* change default

* changeset

* md
This commit is contained in:
Toshii 2025-05-01 10:27:37 -07:00 committed by GitHub
parent 03d44105cc
commit 77c9863b50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"claude-dev": minor
---
create clinerules folder if its currently a file and creating new rule

View File

@ -221,7 +221,14 @@ export const createRuleFile = async (isGlobal: boolean, filename: string, cwd: s
filePath = path.join(globalClineRulesFilePath, filename)
} else {
const localClineRulesFilePath = path.resolve(cwd, GlobalFileNames.clineRules)
const hasError = await ensureLocalClinerulesDirExists(cwd)
if (hasError === true) {
return { filePath: null, fileExists: false }
}
await fs.mkdir(localClineRulesFilePath, { recursive: true })
filePath = path.join(localClineRulesFilePath, filename)
}