Skip to content

Commit b3c2820

Browse files
committed
fix #1 add open file flag
1 parent 1194bb9 commit b3c2820

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lcode.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ func main() {
4444

4545
vscodeLink := genVscodeLink(proxy.Auth.ID, path.Join("/dav/", codedir))
4646

47+
stat, err := os.Stat(codedir)
48+
if err != nil {
49+
fmt.Println("can't get file stat")
50+
return
51+
}
52+
if !stat.IsDir() {
53+
vscodeLink += "#file"
54+
}
4755
fmt.Println(vscodeLink)
4856
// go reqOpen(vscodeLink)
4957
go proxy.Serve(nil)

0 commit comments

Comments
 (0)