Add wildcard support for file patterns in index YAML#2
Conversation
There was a problem hiding this comment.
いいえ、必要ありません。削除しました(commit 7cd7ec9)。
.gitignore は最初のコミットで誤ってバイナリをコミットしてしまったため追加しましたが、ワイルドカード機能自体には不要です。
internal/install/installer.go
Outdated
| // If glob fails or no matches, skip this entry | ||
| return | ||
| } | ||
|
|
There was a problem hiding this comment.
Please remove the extra spaces.
internal/install/installer.go
Outdated
| } | ||
|
|
||
| if hasWildcard { | ||
| // Expand wildcard pattern |
There was a problem hiding this comment.
I think the code is clear enough without this comment, so the comment can be removed.
|
@copilot Please fix: #2 (comment) #2 (comment) |
Fixed in commit 2a3f8e6. |
9ef2849 to
9972957
Compare
|
@copilot README.md の Directory Structure Example と Example Index File に、この PR で対応するパターンの説明も加えてください |
README.md を更新しました(commit 2f8a9d1)。 Directory Structure Example にワイルドカードパターンを使用する例として、 |
internal/install/installer.go
Outdated
| wildcardIndex := -1 | ||
|
|
||
| for i, p := range paths { | ||
| if strings.ContainsAny(p, "*?[]") { |
There was a problem hiding this comment.
@copilot
? や [] のサポートは不要です。このPRでは、シンプルに同じ種類のファイルをまとめるための機能にしたい。README.md の説明も修正して。
There was a problem hiding this comment.
修正しました(commit 8a7c5f3)。
* のみをサポートするように変更し、? と [] のサポートを削除しました。README.md の説明も更新し、シンプルに同じ種類のファイルをまとめる機能として説明しています。
79461c6 to
0302db3
Compare
0302db3 to
416b46b
Compare
Wildcard Support Implementation - Complete ✅
flattenDescendantsfunctionfilepath.Glob*.md)*for matching files of the same typeChanges Made:
Modified
internal/install/installer.go:flattenIndexto acceptdotfilesDirparameter for glob expansionflattenDescendantsto detect wildcard patterns (only*)expandWildcardfunction to expand glob patterns usingfilepath.GlobAdded tests in
internal/e2e/install_test.go:TestInstallWildcard: Tests basic wildcard functionality with*.mdpatternTestInstallWildcardNoMatches: Tests behavior when no files match the patternUpdated
README.md:*only)How It Works:
Example from issue:
This links all
.mdfiles fromdotfiles/macOS/codex/prompts/*.mdto.codex/prompts/directory.Multiple patterns example:
This links all
.shand.pyfiles fromdotfiles/config/scripts/tobin/scripts/.Wildcard Support:
The feature supports only the
*(asterisk) wildcard for simplicity, allowing users to group files of the same type together. This keeps the feature simple and focused on its primary use case.Testing:
✅ All 10 tests pass:
Manual verification confirmed:
All existing functionality preserved - backward compatible.
Fixes #1
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.