MySQLConverterTool icon indicating copy to clipboard operation
MySQLConverterTool copied to clipboard

Default use of directory recursion, problems with backup/overwrite

Open Mabu2 opened this issue 6 years ago • 3 comments

Using the -d parameter with the cli.php command line interface, causes recursive conversion of nested subdirectories.

(this doesn't appear to be mentioned in any documentation and can be quite a shock to anybody who wanted to test the conversion within a small scope - I ran this in what I thought was a sandbox and it crawled symlinks and damaged production code)

There should be an option to enable/disable directory recursion, and allow use of a single directory. (NOTE that you cannot apparently specify a directory via the -p command, that seems to take filespecs only)

I recommend the addition of the following extra commands:

  • enable/disable directory recursion (it should default to no recursion and use something like -R for recursion)

  • skip conversion/backup of any file for which there's already a .org file present - since there is no warning, you can hose the original copies of a converted file with a subsequent run of the conversion script. There should be an option to enable a check to make sure this doesn't happen.

Mabu2 avatar Mar 14 '19 18:03 Mabu2

by the way, other than that.. really like the script! Excellent work!

Mabu2 avatar Mar 14 '19 18:03 Mabu2

where you able to use the -d param and the files saved/updated? If so would you mind showing me what you did? Here is my command and it seems to run but the files never update

php cli.php -d /path/to/dir -p "*.php"

bannostookaylo avatar Jun 13 '19 19:06 bannostookaylo

Nevermind looks like I missed the -u flag here is my final command incase anyone else runs across this

php cli.php -d /path/to/dir -p "*.php" -u -q

bannostookaylo avatar Jun 13 '19 19:06 bannostookaylo