interpolate issue resolved
parent
54d95aa582
commit
879f07ec4b
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
#
|
#
|
||||||
echo test from script
|
echo test from script
|
||||||
/usr/bin/dialog --title "This should be one argument" --inputbox "Enter your name:" 0 0
|
#/usr/bin/dialog --title "This should be one argument" --inputbox "Enter your name:" 0 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set -a
|
set -a
|
||||||
|
|
||||||
echo "variables file says hello and set a variable named TEST_VAR"
|
echo "variables file says hello and set a variable named TEST_VAR"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"plan": [
|
"plan": [
|
||||||
{ "name": "independent test 1", "dependencies": [ null ] }
|
{ "name": "independent test 1", "dependencies": [ null ] },
|
||||||
|
{ "name": "independent test 2", "dependencies": [ null ] }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,24 @@
|
||||||
"group": "$USER",
|
"group": "$USER",
|
||||||
"supply_environment": true,
|
"supply_environment": true,
|
||||||
"environment": "environments/rex.variables"
|
"environment": "environments/rex.variables"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "independent test 2",
|
||||||
|
"target": "components/independent_test_1.bash --ls -s --arg",
|
||||||
|
"is_shell_command": true,
|
||||||
|
"shell_definition": "bash",
|
||||||
|
"force_pty": true,
|
||||||
|
"set_working_directory": false,
|
||||||
|
"working_directory": "",
|
||||||
|
"rectify": false,
|
||||||
|
"rectifier": "echo rectifier executed",
|
||||||
|
"active": true,
|
||||||
|
"required": true,
|
||||||
|
"set_user_context": true,
|
||||||
|
"user": "$USER",
|
||||||
|
"group": "$USER",
|
||||||
|
"supply_environment": true,
|
||||||
|
"environment": "environments/rex.variables"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,11 +321,6 @@ int execute(
|
||||||
close(watched_fds[this_fd].fd);
|
close(watched_fds[this_fd].fd);
|
||||||
break_out = true;
|
break_out = true;
|
||||||
}
|
}
|
||||||
// if (watched_fds[this_fd].revents & POLLHUP) {
|
|
||||||
// // this pipe has hung up
|
|
||||||
// close(watched_fds[this_fd].fd);
|
|
||||||
// break_out = true;
|
|
||||||
// }
|
|
||||||
if (watched_fds[this_fd].revents & POLLHUP) {
|
if (watched_fds[this_fd].revents & POLLHUP) {
|
||||||
// this pipe has hung up
|
// this pipe has hung up
|
||||||
// don't close the file descriptor yet, there might still be data to read
|
// don't close the file descriptor yet, there might still be data to read
|
||||||
|
|
|
@ -108,7 +108,7 @@ int exec_pty(
|
||||||
// before we fork the process, so that the child process will inherit the environment
|
// before we fork the process, so that the child process will inherit the environment
|
||||||
// from the parent process
|
// from the parent process
|
||||||
if ( environment_supplied ) {
|
if ( environment_supplied ) {
|
||||||
clearenv();
|
//clearenv();
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn our command string into something execvp can consume
|
// turn our command string into something execvp can consume
|
||||||
|
|
|
@ -101,10 +101,22 @@ std::string get_8601()
|
||||||
*
|
*
|
||||||
* @param text The input text to be processed
|
* @param text The input text to be processed
|
||||||
*/
|
*/
|
||||||
|
//void interpolate( std::string & text )
|
||||||
|
//{
|
||||||
|
// static std::regex env1( "\\$\\{([^}]+)\\}" );
|
||||||
|
// static std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found
|
||||||
|
// std::smatch match;
|
||||||
|
// while ( std::regex_search( text, match, env1 ) || std::regex_search( text, match, env2 ) )
|
||||||
|
// {
|
||||||
|
// const char * s = getenv( match[1].str().c_str() );
|
||||||
|
// const std::string var( s == NULL ? "" : s );
|
||||||
|
// text.replace( match[0].first, match[0].second, var );
|
||||||
|
// }
|
||||||
|
//}
|
||||||
void interpolate( std::string & text )
|
void interpolate( std::string & text )
|
||||||
{
|
{
|
||||||
static std::regex env1( "\\$\\{([^}]+)\\}" );
|
std::regex env1( "\\$\\{([^}]+)\\}" );
|
||||||
static std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found
|
std::regex env2( "\\$([^/]+)" ); // matches $VAR_NAME until a / is found
|
||||||
std::smatch match;
|
std::smatch match;
|
||||||
while ( std::regex_search( text, match, env1 ) || std::regex_search( text, match, env2 ) )
|
while ( std::regex_search( text, match, env1 ) || std::regex_search( text, match, env2 ) )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue