Schema for verMan version managers. Currently, this includes JSON & TOML examples and serde Rust struct
s.
For more information see https://verMan.io
These constants are accessible in the TOML/YAML/JSON file using ${}
syntax, like ${OS} == \"windows\"
in a when
field.
ARCH
, string (see https://github.com/rust-lang/rust/blob/1.77.0/library/std/src/env.rs#L916-L936)FAMILY
, string (see https://github.com/rust-lang/rust/blob/1.77.0/library/std/src/env.rs#L938-L945)OS
, string (see https://github.com/rust-lang/rust/blob/1.77.0/library/std/src/env.rs#L947-L961)BUILD_TIME
,std::time::SystemTime
Configuration resolution should be straightforward. To remove ambiguity, this is documented below.
- System environment variables added to internal dictionary
vars
constants
upserted to internal dictionaryvars
env_vars
JSON-objects upserted to internal dictionaryvars
String
s${NAME}
evaluated using aforementionedvars
and predefined constants; whenNAME
not found${NAME}
is left as${NAME}
String
s with shebang evaluation a) implicitly takes config file-contents asstdin
b) aforementionedvars
are made available to shebang-evaluated c)#!/jq
isn't realjq
but the#RewriteInRust
jaq
compiled into this library d) Similarly, the normal shebang isn't real. This library handles execution; by reading the first line; making this far more portable (e.g., to Windows [both CMD and PowerShell]).- Similar to
$ref
of JSON-reference (common in JSON-schema) cross-referencing can occur and thus multiple passes may be required to fully-resolve variables
$ cargo rustc --crate-type cdylib --release
On my x86_64 Linux box this produces:
3.7M ./target/release/deps/libserde_derive-b66a5407fc23d48c.so
16K ./target/release/deps/libverman_schema_rs.so
16K ./target/release/libverman_schema_rs.so
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.