ufoscout/docker-compose-wait

[BUG] WAIT_COMMAND does not work correctly

WagnerPMC opened this issue · 1 comments

Hello,

I notice that the executable command is inserted into the arguments of the same executable command:

let argv = shell_words::split(&command_string)?;
Ok(Some((
Command {
program: argv[0].clone(),
argv,
},
command_string,
)))

In this way, it turns out that the conditional "hello man" command turns into the "hello hello man" command.
To prevent this from happening, we need to remove the first element of the vector from the argv variable, in the same place.

Quick fix:

let mut argv = shell_words::split(&command_string)?;

Ok(Some((
    Command {
        program: argv.remove(0),
        argv,
    },
    command_string,
)))

If it's a hassle, I can create a PR for a quick fix - just let me know.

Fixed by #78