File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { revealPostListItem } from '@/service/post/post-list-view'
99import { PostTreeItem } from '@/tree-view/model/post-tree-item'
1010import { MarkdownCfg } from '@/ctx/cfg/markdown'
1111import { fsUtil } from '@/infra/fs/fsUtil'
12+ import { WorkspaceCfg } from '@/ctx/cfg/workspace'
1213
1314export async function postPull ( input : Post | PostTreeItem | Uri | undefined | null , showConfirm = true , mute = false ) {
1415 const ctxList : CmdCtx [ ] = [ ]
@@ -17,7 +18,11 @@ export async function postPull(input: Post | PostTreeItem | Uri | undefined | nu
1718 if ( parsePostInput ( input ) && input . id > 0 ) {
1819 const post = input
1920 const path = PostFileMapManager . getFilePath ( post . id )
20- if ( path === undefined || ! ( await fsUtil . exists ( path ) ) ) {
21+ if (
22+ path === undefined ||
23+ ! ( await fsUtil . exists ( path ) ) ||
24+ path . indexOf ( WorkspaceCfg . getWorkspaceUri ( ) . path ) < 0
25+ ) {
2126 isFreshPull = true
2227 const uri = await buildLocalPostFileUri ( post , false )
2328 await workspace . fs . writeFile ( uri , Buffer . from ( post . postBody ) )
You can’t perform that action at this time.
0 commit comments