Skip to content

Commit

Permalink
wip remove minijinja
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh committed Dec 20, 2023
1 parent 6d5e86d commit c10b247
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 228 deletions.
30 changes: 0 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ publish = true


[dependencies]
minijinja = "1.0.10"
shlex = "1.2.0"
strum = { version = "0.25", features = ["derive"] }
strum_macros = "0.25"
Expand Down
14 changes: 13 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::env;
use std::fmt::Display;
use std::fs;
use std::fs::File;
use std::io::prelude::*;
use std::process;
use std::process::Command;
use thiserror::Error as ThisError;
Expand Down Expand Up @@ -533,14 +534,25 @@ impl Action {
http_conf: http_conf(&mut user),
events_conf: vec![format!("worker_connections {};", user.worker_connections)],
lua_loader,
resty_compat_version: crate::nginx::get_resty_compat_version(),
};

let conf_path = prefix.conf.join("nginx.conf");
if let Err(e) = fs::write(conf_path, render_config(vars)) {
let mut file = match fs::File::create(conf_path) {
Ok(file) => file,
Err(e) => {
eprintln!("failed opening nginx.conf for writing: {}", e);
return 2;
}
};

if let Err(e) = render_config(&mut file, vars).and_then(|_| file.flush()) {
eprintln!("failed writing nginx.conf file: {}", e);
return 2;
}

drop(file);

let ngx = NginxExec {
bin: find_nginx_bin(user.nginx_bin).to_str().unwrap().to_string(),
prefix: prefix.root.to_str().unwrap().to_string(),
Expand Down
172 changes: 0 additions & 172 deletions src/nginx.conf.tpl

This file was deleted.

Loading

0 comments on commit c10b247

Please sign in to comment.