nixys / nxs-data-anonymizer

A tool for anonymizing PostgreSQL and MySQL databases' dump
Apache License 2.0
233 stars 10 forks source link

feat. Allow to specify arguments for commands value. #42

Open Kirillpt opened 3 months ago

Kirillpt commented 3 months ago

The basic use of the custom script in yml conf is to specify the path to the executable with a shebang string value: '/path/to/script'. If you try to pass something like "/bin/python /path/to/script.py", it will fail, because exec.Command() when get an argument, treats it as a command name to do. This changes split command from the yml config by spaces. The new first string is is a command name, and the others are args. If you want to do some bash thing with piping, it's better to pass the value like this "bash -c date | awk '{print $2}'"