Skip to content

Commit 81acbbd

Browse files
committed
update javbus
1 parent bcadfb5 commit 81acbbd

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

grab_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package scrape
22

33
import (
4+
"os"
45
"testing"
56

67
"github.com/javscrape/go-scrape/net"
@@ -32,3 +33,14 @@ func TestGrabJAVBUS_Find(t *testing.T) {
3233
t.Fatal(err)
3334
}
3435
}
36+
func TestStat(t *testing.T) {
37+
info, e := os.Stat("grab_test.go")
38+
t.Log(os.IsNotExist(e))
39+
t.Log(os.IsExist(e))
40+
t.Log(info, e)
41+
42+
info1, e1 := os.Stat("grab_test1.go")
43+
t.Log(os.IsNotExist(e1))
44+
t.Log(os.IsExist(e1))
45+
t.Log(info1, e1)
46+
}

scrape.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"path/filepath"
99
"strconv"
10+
"strings"
1011

1112
"github.com/javscrape/go-scrape/net"
1213
)
@@ -111,7 +112,7 @@ func (impl *scrapeImpl) Find(name string) (msg *[]*Content, e error) {
111112
}
112113

113114
func copyCache(cache *net.Cache, msg *Content, output string) (e error) {
114-
pid := filepath.Join(output, msg.ID)
115+
pid := filepath.Join(output, strings.ToUpper(msg.ID))
115116
e = copyFile(cache, msg.Image, filepath.Join(pid, "image"))
116117
if e != nil {
117118
return e
@@ -140,7 +141,7 @@ func copyCache(cache *net.Cache, msg *Content, output string) (e error) {
140141
}
141142

142143
func copyInfo(msg *Content, path string) error {
143-
pid := filepath.Join(path, msg.ID)
144+
pid := filepath.Join(path, strings.ToUpper(msg.ID))
144145
inf := filepath.Join(pid, "inf.json")
145146
_ = os.MkdirAll(filepath.Dir(inf), os.ModePerm)
146147
info, e := os.Stat(inf)

0 commit comments

Comments
 (0)