Skip to main content

copy_env_from_example

Function copy_env_from_example 

Source
pub fn copy_env_from_example(src: &str, dst: &str) -> Option<Fix>
Expand description

Builds the reversible .env.example → .env copy fix, if applicable.

Returns None when there is no template to copy from.

use limitless_cli::modules::fixes::{copy_env_from_example, FixCommand};

let fix = copy_env_from_example(".env.example", ".env");
let fix = fix.expect("copy fix is always built from explicit paths");
assert_eq!(fix.reversible, true);
assert_eq!(fix.requires_approval, true);
assert!(matches!(fix.command, FixCommand::CopyFile { .. }));