stamp-cli 0.3.2

A cli tool for applying project templates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::env;

pub struct Config {
    pub host_address: String,
}

impl Config {
    /// Load the configuration from the environment. Panics if a required variable is not set.
    pub fn from_env() -> Self {
        return Self {
            host_address: env("SERVER_HOST_ADDRESS"),
        };
    }
}

fn env(var: &str) -> String {
    return env::var(var).expect(&*format!("`{var}` must be set."));
}