Files
cell/docs/api/modules/resources.md
2025-02-09 00:07:01 -06:00

1.1 KiB

resources

resources

canonical(file)

find_image(...args)

find_sound(...args)

find_script(...args)

find_font(...args)

getAllFiles(dir)

Return a list of recognized files in the given directory that are not matched by .prosperonignore, skipping directories. Recognized extensions include scripts, images, sounds, fonts, and libs.

dir: The directory to search.

Returns: An array of recognized file paths.

gatherStats(filePaths)

Analyze a list of recognized files and categorize them by scripts, images, sounds, fonts, libs, or other. Return a stats object with these counts and the total.

filePaths: An array of file paths to analyze.

Returns: { scripts, images, sounds, fonts, lib, other, total }

pack(dir, outPath)

Create a ZIP archive of all recognized files (skipping those matched by .prosperonignore) in the specified directory and write it to outPath. Recognized extensions are scripts, images, sounds, fonts, or libs.

:raises Error: If the directory does not exist.

dir: The directory to zip.

outPath: The path (including filename) for the resulting ZIP file.

Returns: None