diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index d231b523..471d6bad 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -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: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 55410952..9ebf2a0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/clippy.go b/clippy.go index 8924c512..c50d833c 100644 --- a/clippy.go +++ b/clippy.go @@ -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) } diff --git a/clippy_test.go b/clippy_test.go index fb72bcae..0edf87d7 100644 --- a/clippy_test.go +++ b/clippy_test.go @@ -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) } -} \ No newline at end of file +} + +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") + } +}