service.env validation
This commit is contained in:
27
source/src/utils/env_validator.hpp
Normal file
27
source/src/utils/env_validator.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#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
|
||||
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
|
||||
);
|
||||
|
||||
} // namespace dropshell
|
||||
|
||||
#endif // ENV_VALIDATOR_HPP
|
||||
Reference in New Issue
Block a user