- Set # migrated from: optional from migrate script

This commit is contained in:
Dave Mc Nicoll 2023-03-01 11:33:33 -05:00
parent e3e922e3bf
commit 7c7d8c9d8d
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
array_shift($argv); array_shift($argv);
$opt = getopt('c::f:v', [ 'folder:', 'confirm', 'verbose', 'clean' ]); $opt = getopt('c::f:v', [ 'folder:', 'confirm', 'verbose', 'clean', 'old' ]);
if ( ! $opt ) { if ( ! $opt ) {
exit("Bad arguments provided, you must specify a fullpath using the -f or --folder option\n"); exit("Bad arguments provided, you must specify a fullpath using the -f or --folder option\n");
@ -96,7 +96,7 @@ foreach ($iterator as $info) {
$renderedArgs = ""; $renderedArgs = "";
} }
$attr[] = $attribute = sprintf("%s#[%s%s]%s", str_repeat(" ", strlen($line) - strlen(ltrim($line)) >= 4 ? 4 : 0), $name, $renderedArgs ? "($renderedArgs)" : "", $renderedArgs ? " # migrated from: $args" : ""); $attr[] = $attribute = sprintf("%s#[%s%s]%s", str_repeat(" ", strlen($line) - strlen(ltrim($line)) >= 4 ? 4 : 0), $name, $renderedArgs ? "($renderedArgs)" : "", $renderedArgs ? ( isset($opt['old']) ? " # migrated from: $args" : "" ) : "");
$newContent[] = $attribute; $newContent[] = $attribute;
} }