Skip to content

Commit

Permalink
chore(examples): update example to use test file
Browse files Browse the repository at this point in the history
  • Loading branch information
CompeyDev committed Jan 6, 2025
1 parent 3e9b3a3 commit e7a654d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/tour.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ local fs = require("@lune/fs")
local stdio = require("@lune/stdio")
local zip = require("../lib")

local file = fs.readFile("test.zip")
local file = fs.readFile("tests/data/files_and_dirs.zip")
local reader = zip.load(buffer.fromstring(file))

print("Directory structure:")
reader:walk(function(entry, depth)
local prefix = string.rep(" ", depth)
local suffix = if not entry.isDirectory
then string.format(" (%d bytes), content: %s", entry.size, stdio.format(reader:extract(entry) :: string))
then string.format(" (%d bytes), content: %s", entry.size, reader:extract(entry, { isString = true }) :: string)
else ""
print(prefix .. entry.name .. suffix)
end)
Expand Down

0 comments on commit e7a654d

Please sign in to comment.