30 lines
1.1 KiB
C++
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
|