diff --git a/src/cmd/post-list/post-pull.ts b/src/cmd/post-list/post-pull.ts index a4fd9f9c..79a10fc4 100644 --- a/src/cmd/post-list/post-pull.ts +++ b/src/cmd/post-list/post-pull.ts @@ -9,6 +9,7 @@ import { revealPostListItem } from '@/service/post/post-list-view' import { PostTreeItem } from '@/tree-view/model/post-tree-item' import { MarkdownCfg } from '@/ctx/cfg/markdown' import { fsUtil } from '@/infra/fs/fsUtil' +import { WorkspaceCfg } from '@/ctx/cfg/workspace' export async function postPull(input: Post | PostTreeItem | Uri | undefined | null, showConfirm = true, mute = false) { const ctxList: CmdCtx[] = [] @@ -17,7 +18,11 @@ export async function postPull(input: Post | PostTreeItem | Uri | undefined | nu if (parsePostInput(input) && input.id > 0) { const post = input const path = PostFileMapManager.getFilePath(post.id) - if (path === undefined || !(await fsUtil.exists(path))) { + if ( + path === undefined || + !(await fsUtil.exists(path)) || + path.indexOf(WorkspaceCfg.getWorkspaceUri().path) < 0 + ) { isFreshPull = true const uri = await buildLocalPostFileUri(post, false) await workspace.fs.writeFile(uri, Buffer.from(post.postBody))