// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ // ┃ Copyright: (c) 2023, Mike 'PhiSyX' S. (https://github.com/PhiSyX) ┃ // ┃ SPDX-License-Identifier: MPL-2.0 ┃ // ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃ // ┃ ┃ // ┃ This Source Code Form is subject to the terms of the Mozilla Public ┃ // ┃ License, v. 2.0. If a copy of the MPL was not distributed with this ┃ // ┃ file, You can obtain one at https://mozilla.org/MPL/2.0/. ┃ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ mod env_vars_site; use std::process; use console::style; use env_vars_site::applications::Application; #[tokio::main] async fn main() -> impl process::Termination { let application = match Application::new( env!("CARGO_BIN_NAME"), env!("CARGO_PKG_VERSION"), format!("{}/examples/env_vars_site", env!("CARGO_MANIFEST_DIR")), ) .await { | Ok(application) => application.setup(), | Err(err) => return exit(err), }; if let Err(err) = application.run().await { return exit(err); } process::ExitCode::SUCCESS } fn exit(err: impl std::error::Error) -> process::ExitCode { eprintln!( "{} {}: {}", style("error").red(), style(env!("CARGO_BIN_NAME")).red(), err, ); process::ExitCode::FAILURE }