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'
9
9
import { PostTreeItem } from '@/tree-view/model/post-tree-item'
10
10
import { MarkdownCfg } from '@/ctx/cfg/markdown'
11
11
import { fsUtil } from '@/infra/fs/fsUtil'
12
+ import { WorkspaceCfg } from '@/ctx/cfg/workspace'
12
13
13
14
export async function postPull ( input : Post | PostTreeItem | Uri | undefined | null , showConfirm = true , mute = false ) {
14
15
const ctxList : CmdCtx [ ] = [ ]
@@ -17,7 +18,11 @@ export async function postPull(input: Post | PostTreeItem | Uri | undefined | nu
17
18
if ( parsePostInput ( input ) && input . id > 0 ) {
18
19
const post = input
19
20
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
+ ) {
21
26
isFreshPull = true
22
27
const uri = await buildLocalPostFileUri ( post , false )
23
28
await workspace . fs . writeFile ( uri , Buffer . from ( post . postBody ) )
You can’t perform that action at this time.
0 commit comments