Skip to content

Commit

Permalink
roblox/bootstrapper: handle zip size in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Dec 6, 2023
1 parent 3fa6b0c commit ce4a006
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 12 additions & 6 deletions roblox/bootstrapper/pkg_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ var (
)

type Package struct {
Name string
Checksum string
Size int64
Name string
Checksum string
Size int64
ZipSize int64
}

type Packages []Package
Expand Down Expand Up @@ -94,15 +95,20 @@ func ParsePackages(manifest []string) (Packages, error) {
continue
}

size, err := strconv.ParseInt(manifest[i+3], 10, 64)
zs, err := strconv.ParseInt(manifest[i+2], 10, 64)
if err != nil {
return pkgs, err
}

s, err := strconv.ParseInt(manifest[i+3], 10, 64)
if err != nil {
return pkgs, err
}

pkgs = append(pkgs, Package{
Name: manifest[i],
Checksum: manifest[i+1],
Size: size,
Size: s,
ZipSize: zs,
})
}

Expand Down
2 changes: 2 additions & 0 deletions roblox/bootstrapper/pkg_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ func TestParsePackages(t *testing.T) {
Name: "foo.zip",
Checksum: "026b271a21b03f2e564c036525356db5",
Size: 109436874,
ZipSize: 71367142,
}

pkgBarWant := Package{
Name: "bar.zip",
Checksum: "4d9ec7b52a29c80f3ce1f6a65b14b563",
Size: 1191394,
ZipSize: 408629,
}

if pkgs[0] != pkgFooWant {
Expand Down

0 comments on commit ce4a006

Please sign in to comment.