Package Zipper
zip-package
9.2

Package Zipper🔗ℹ

Hans Dijkema

 (require package-zipper) package: package-zipper

procedure

(zip-package [directory #:exclude exclude])  path?

  directory : path-string? = (current-directory)
  exclude : (listof (or/c string? path? regexp? byte-regexp?))
   = null
Reads "info.rkt" in directory, obtains its 'version value, and creates a ZIP archive in the parent directory.

The output filename is formed from the package directory name and version. For example, package directory "racket-upnp" with version 5.0 produces "racket-upnp-5.0.zip".

The directory is archived recursively. The following paths are omitted:

  • ".git" directories and files

  • "compiled" directories and files

  • names ending in ~

  • names ending in .bak, without regard to case

  • .html, .js, and .css files below directories named "scribblings", "scribbles", or "scrbl", without regard to case

The optional exclude list adds exclusions. A string matches an equal file or directory name anywhere in the relative path. A relative path value matches that path and everything below it. A regular expression is applied to the complete relative path, with / as the path separator. Custom string and path comparisons are case-sensitive.

For example:

(zip-package
 #:exclude
 (list "tmp"
       (string->path "examples/generated")
       #rx"^tests/data/"))

The package files are stored at the root of the archive. An existing archive with the same name is replaced. The resulting complete path is returned.