diff --git a/devenv/src/devenv.rs b/devenv/src/devenv.rs index d35baa331..4e2bffdc6 100644 --- a/devenv/src/devenv.rs +++ b/devenv/src/devenv.rs @@ -23,13 +23,13 @@ const FLAKE_TMPL: &str = include_str!("flake.tmpl.nix"); const REQUIRED_FILES: [&str; 4] = ["devenv.nix", "devenv.yaml", ".envrc", ".gitignore"]; const EXISTING_REQUIRED_FILES: [&str; 1] = [".gitignore"]; const PROJECT_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/init"); -static DIRENVRC: Lazy = Lazy::new(|| { +pub static DIRENVRC: Lazy = Lazy::new(|| { include_str!("../../direnvrc").replace( "DEVENV_DIRENVRC_ROLLING_UPGRADE=0", "DEVENV_DIRENVRC_ROLLING_UPGRADE=1", ) }); -static DIRENVRC_VERSION: Lazy = Lazy::new(|| { +pub static DIRENVRC_VERSION: Lazy = Lazy::new(|| { DIRENVRC .lines() .find(|line| line.contains("export DEVENV_DIRENVRC_VERSION")) @@ -846,7 +846,7 @@ impl Devenv { self.devenv_tmp, self.devenv_runtime.display(), is_testing, - DIRENVRC_VERSION + DIRENVRC_VERSION.to_string() ); let flake = FLAKE_TMPL.replace("__DEVENV_VARS__", &vars); let flake_path = self.devenv_root.join(DEVENV_FLAKE); diff --git a/devenv/src/main.rs b/devenv/src/main.rs index 8379a864c..235a65f76 100644 --- a/devenv/src/main.rs +++ b/devenv/src/main.rs @@ -22,7 +22,7 @@ async fn main() -> Result<()> { let command = match cli.command { None | Some(Commands::Version) => return print_version(), Some(Commands::Direnvrc) => { - print!("{}", devenv::DIRENVRC); + print!("{}", devenv::DIRENVRC.to_string()); return Ok(()); } Some(cmd) => cmd,