5 Commits

Author SHA1 Message Date
Master
3517b9cc11 repair target string 2020-06-20 23:14:04 -04:00
Master
137c82ebaa repair target string 2020-06-20 23:07:14 -04:00
Master
e49cc335f3 fixing execution context for targets 2020-06-20 23:05:51 -04:00
Master
4ea05b842a minor repair of usage of env vars file 2020-06-20 23:00:55 -04:00
Master
3bc60f56de minor repair of usage of env vars file 2020-06-20 22:57:30 -04:00
2 changed files with 5 additions and 5 deletions

View File

@@ -124,9 +124,9 @@ Conf::Conf( std::string filename, int LOG_LEVEL ): JSON_Loader( LOG_LEVEL ), slo
this->env_vars_file_literal = this->execution_context_literal + "/" + this->env_vars_file.asString();
if ( exists( this->env_vars_file_literal ) )
if ( exists( this->get_env_vars_file() ) )
{
this->slog.log( E_DEBUG, "Environment variables file exists: '" + this->env_vars_file_literal + "'." );
this->slog.log( E_DEBUG, "Environment variables file exists: '" + this->get_env_vars_file() + "'." );
} else {
this->slog.log( E_FATAL, "Variables file does not exist: '" + this->env_vars_file_literal + "'.");
throw ConfigLoadException( "env_vars_file points to an incorrect path." );

View File

@@ -184,7 +184,7 @@ void Task::execute( Conf * configuration )
// END PREWORK
// get the target execution command
std::string target_command = this->definition.get_target();
std::string target_command = configuration->get_execution_context() + + "/" + this->definition.get_target();
// check if context override
if ( configuration->has_context_override() )
@@ -198,9 +198,9 @@ void Task::execute( Conf * configuration )
// a[0] execute target
// TODO revise variable sourcing strategy
this->slog.log( E_DEBUG, "Loading environment variable file: " + configuration->get_env_vars_file() );
this->slog.log( E_INFO, "Executing target: \"" + target_command + "\"." );
int return_code = Sproc::execute( "source " + configuration->get_env_vars_file() + " && " + target_command );
this->slog.log( E_DEBUG, "Vars file: " + configuration->get_env_vars_file() );
int return_code = Sproc::execute( ". " + configuration->get_env_vars_file() + " && " + target_command );
// **********************************************
// d[0] Error Code Check