wp-cli / dist-archive-command

Create a distribution .zip or .tar.gz based on a plugin or theme's .distignore file
https://developer.wordpress.org/cli/commands/dist-archive/
MIT License
47 stars 23 forks source link

Fixes retrieval of version string from source files doc blocks (fixes #36) #37

Closed santilin closed 2 years ago

santilin commented 5 years ago

In the issue there is a suggestion to refactor code from the i18n command. However, the code in the i18n command can't be used as is because it only handles functions, and the plugin.php header doesn't have to have a function on it.

I have replaced the former preg_match on the contents of all the php files in the plugin into a more sophisticated way of extracting the version tag:

It's worth noting that the tags might be specified as @version or Version: and that a leading * might be in the line.

schlessera commented 5 years ago

@santilin Before I do a line-by-line review of the code, can you please push a commit to fix the indentation, it seems to be all over the place. According to WPCS, please use tabs for indentation, and spaces for alignment only.

santilin commented 5 years ago

@santilin Before I do a line-by-line review of the code, can you please push a commit to fix the indentation, it seems to be all over the place. According to WPCS, please use tabs for indentation, and spaces for alignment only.

Done @schlessera

schlessera commented 5 years ago

@santilin Are you still interested in working on this?

schlessera commented 4 years ago

Gentle ping? :D