Repository navigation
🐛 Fix(gui): create the clipboard image folder before built-in clipboard uploads - #1460
Merged
Molunerfinn merged 1 commit intoNov 13, 2026
Conversation
…rd uploads With the built-in clipboard enabled, the clipboard image is written to <config dir>/picgo-clipboard-images with write-file-atomic, which does not create parent folders. PicGo-Core only creates that folder when its own clipboard script runs, so on a config dir where it is missing the write fails with ENOENT and the upload silently does nothing (Molunerfinn#1375, Molunerfinn#1364, Molunerfinn#1263). Create the folder before writing the image.
Owner
|
Thanks! I will take a look |
Owner
|
Thanks for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With "use built-in clipboard" turned on, uploading a screenshot from the clipboard does nothing when
<config dir>/picgo-clipboard-imagesdoesn't exist.uploadWithBuildInClipboardwrites the PNG there withwrite-file-atomic, which doesn't create parent folders, so the write throws ENOENT, the error only goes to the log and the upload never starts.PicGo-Core creates that folder only when its own clipboard script runs, so the folder can be missing on a fresh config dir, or after switching to a custom config path, if the built-in clipboard is the only one used there.
This is the error in #1375 (Windows; the reporter found that turning the built-in clipboard off made it work), #1364 and #1263 (macOS). The
.png.<number>suffix in those logs is write-file-atomic's temp file, so they come from this code path. The toolbox fix works around it by creating the folder; this change creates it right before the write.fse.ensureDir()on the folder before writing the clipboard imagefalsepnpm vitest run src/__tests__/main/uploader-context.spec.tsfails before the change and passes after; the fullpnpm testsuite,tsc --noEmitand eslint on the touched files pass.