keyflux 0.1.14

A CLI tool and library for synchronizing environment secrets across multiple platforms including local files, GitHub Secrets, Supabase Vault, and Vercel Secrets. It facilitates secure management and automation of sensitive data.
Documentation
pub mod interpolation; // use dotenv::dotenv;
use log::info;
use std::fs::File;
use std::io::prelude::*;

/// Loads environment variables from the specified .env files.
pub fn load_env_files(env_files: &[&str]) {
    for env_file in env_files {
        dotenv::from_filename(env_file).ok();
        info!("Loaded environment variables from {}", env_file);
    }
}

/// Reads the content of a file and returns it as a String.
pub fn read_file_to_string(file_path: &str) -> std::io::Result<String> {
    let mut file = File::open(file_path)?;
    let mut content = String::new();
    file.read_to_string(&mut content)?;
    Ok(content)
}

/// Writes a line to the specified file.
pub fn write_to_file(file_path: &str, content: &str) -> std::io::Result<()> {
    let mut file = File::create(file_path)?;
    file.write_all(content.as_bytes())?;
    Ok(())
}