Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kaplanelad committed Nov 22, 2023
1 parent 85841ee commit 3efb1c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/without-db/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 examples/without-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ eyre = "*"
tokio = { version = "1.33.0", features = ["full"] }
async-trait = "0.1.74"
tracing = "0.1.40"
chrono = "*"
validator = { version = "*" }

axum = "*"
Expand Down
8 changes: 6 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ pub async fn main<H: Hooks, M: MigratorTrait>() -> eyre::Result<()> {
#[cfg(not(feature = "with-db"))]
pub async fn main<H: Hooks>() -> eyre::Result<()> {
let cli = Cli::parse();
let environment = cli
.environment
.or_else(resolve_from_env)
.unwrap_or_else(|| "development".to_string());
match cli.command {
Commands::Start {
worker,
Expand All @@ -248,15 +252,15 @@ pub async fn main<H: Hooks>() -> eyre::Result<()> {
StartMode::ServerOnly
};

let boot_result = create_app::<H>(start_mode, &cli.environment).await?;
let boot_result = create_app::<H>(start_mode, &environment).await?;
start(boot_result).await?;
}
Commands::Task { name, params } => {
let mut hash = BTreeMap::new();
for (k, v) in params {
hash.insert(k, v);
}
let app_context = create_context(&cli.environment).await?;
let app_context = create_context(&environment).await?;
run_task::<H>(&app_context, name.as_ref(), &hash).await?;
}
Commands::Generate { component } => {
Expand Down
1 change: 1 addition & 0 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use serde_variant::to_variant_name;
use super::config::Config;
use crate::Result;

#[must_use]
pub fn resolve_from_env() -> Option<String> {
std::env::var("RR_ENV")
.or_else(|_| std::env::var("RAILS_ENV"))
Expand Down

0 comments on commit 3efb1c9

Please sign in to comment.