Files
dropshell/source/src/utils/env_validator.hpp
j 729a20707a
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 50s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m18s
feat: Update 3 files
2025-10-12 11:51:32 +13:00

30 lines
1.1 KiB
C++

#ifndef ENV_VALIDATOR_HPP
#define ENV_VALIDATOR_HPP
#include <string>
#include <vector>
namespace dropshell {
// Validates that a service's service.env file matches the template's service.env file
// Returns true if validation passes
// Returns false if there are mismatches (and fixes them by adding missing vars and commenting out extras)
//
// Parameters:
// template_service_env_path: Full path to the template's service.env file
// service_env_path: Full path to the service's service.env file
// missing_vars: Output parameter - list of variable names that were missing and added
// extra_vars: Output parameter - list of variable names that were extra and commented out
// template_info_env_path: Optional path to .template_info.env - variables from this file are allowed in service.env
bool validate_and_fix_service_env(
const std::string& template_service_env_path,
const std::string& service_env_path,
std::vector<std::string>& missing_vars,
std::vector<std::string>& extra_vars,
const std::string& template_info_env_path = ""
);
} // namespace dropshell
#endif // ENV_VALIDATOR_HPP