jaemk / self_update

Self updates for rust executables
MIT License
798 stars 70 forks source link

Support variable substitutions in `bin_path_in_archive` #127

Closed my4ng closed 7 months ago

my4ng commented 7 months ago

This fixes #122 by allowing bin_path_in_archive to refer to variables that are only available at runtime, especially the release version, which may not be known when getting the latest release without additional queries. It uses {{ var }} syntax and supports bin, target and version.

Example:

myapp.tar/
 |------- windows-1.2.3-bin/
 |         |--- myapp  # <-- executable

Use "{{ target }}-{{ version }}-bin/{{ bin }}" for bin_path_in_archive.

Note:

The regex that matches the syntax accepts zero or more ASCII whitespace characters around the var. Hence both {{var}} and {{ var }} would work.

jaemk commented 7 months ago

Thanks @my4ng !