Skip to content

Commit 29bf86a

Browse files
atomikpandaclaude
andcommitted
Fix ResolvedTarget treating dotfile directories as file paths
filepath.Ext(".claude") returns ".claude" (non-empty), causing destinations like ~/.claude to be treated as complete file paths instead of directories. Add an os.Stat check so existing directories always get the source basename appended. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3f286ed commit 29bf86a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/actions/file.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ type FileAction struct {
4949
func (a *FileAction) ResolvedTarget() string {
5050
expanded := platform.ExpandPath(a.Destination)
5151
base := filepath.Base(expanded)
52+
// If the path is an existing directory, always append the source basename.
53+
if info, err := os.Stat(expanded); err == nil && info.IsDir() {
54+
return filepath.Join(expanded, filepath.Base(a.Source))
55+
}
5256
if !strings.HasSuffix(a.Destination, "/") && filepath.Ext(base) != "" {
5357
return expanded
5458
}

0 commit comments

Comments
 (0)