Shemnei / punktf

⚡ A cross-platform multi-target dotfiles manager

Home Page:https://shemnei.github.io/punktf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inject system variables

Shemnei opened this issue · comments

Maybe punktf should inject some general system variables for templates to use. These will only be accessible by the current process:

  • PUNKTF_OS: OS running the punktf process, like windows, unix, ...
  • PUNKTF_TARGET: Target directory for the profile
  • PUNKTF_SOURCE: Source directory for punktf

Closed on cleanup with 52ed8e5.
The variables are injected as system environment variables local to that process.
The following are implemented:

  • PUNKTF_ARCH: Architecture of the system which compiled punktf
  • PUNKTF_OS: Operating system of the system which compiled punktf
  • PUNKTF_FAMILY: Family of the operating system which compiled punktf

The values for these variables are available at https://doc.rust-lang.org/reference/conditional-compilation.html.