Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
cache: true

- name: Run tests
run: go test -v ./...
run: |
# Run tests sequentially to avoid clipboard conflicts between packages.
go test -v -p 1 ./...

- name: Install golangci-lint
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Notable changes to clippy.

## [Unreleased]

## [1.6.6] - 2026-02-08

### Fixed

- Pasty (and MCP `clipboard_paste`) now supports pasting folders by recursively copying directory references

## [1.6.5] - 2026-02-01

### Added

- MCP metadata overrides now support partial files by default, with `--strict-metadata` for full coverage validation
Expand Down
4 changes: 3 additions & 1 deletion clippy.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,9 @@ func copyFilesToDestination(files []string, destination string, force bool) (int

destFile = findAvailableFilename(destFile, force)

if err := recent.CopyFile(srcFile, destFile); err != nil {
// Clipboard file references can include directories; CopyFileToDestination
// handles both files and folders (recursive copy).
if err := recent.CopyFileToDestination(srcFile, destFile); err != nil {
return filesRead, fmt.Errorf("could not copy %s to %s: %w", srcFile, destFile, err)
}

Expand Down
28 changes: 27 additions & 1 deletion clippy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,30 @@ func TestFindAvailableFilenameWithForce(t *testing.T) {
if got != want {
t.Errorf("findAvailableFilename(%q, true) should return original path when force=true\n got: %q\n want: %q", path, got, want)
}
}
}

func TestCopyFilesToDestination_Directory(t *testing.T) {
srcRoot := t.TempDir()
srcDir := srcRoot + "/src-folder"
if err := os.MkdirAll(srcDir+"/nested", 0755); err != nil {
t.Fatalf("Failed to create source dir: %v", err)
}
if err := os.WriteFile(srcDir+"/nested/file.txt", []byte("hello"), 0644); err != nil {
t.Fatalf("Failed to create source file: %v", err)
}

destRoot := t.TempDir()

// Destination is an existing directory: should copy folder into it.
if _, err := copyFilesToDestination([]string{srcDir}, destRoot, false); err != nil {
t.Fatalf("copyFilesToDestination returned error: %v", err)
}

got, err := os.ReadFile(destRoot + "/src-folder/nested/file.txt")
if err != nil {
t.Fatalf("Expected copied file, got error: %v", err)
}
if string(got) != "hello" {
t.Fatalf("Copied file content mismatch: got %q want %q", string(got), "hello")
}
}