grasmash / composerize-drupal

Convert a non-Composer-managed Drupal application (e.g., one created via tarball) to a Composer-managed Drupal application.
MIT License
125 stars 20 forks source link

running it I get [ErrorException] Undefined offset: 1 #6

Closed GiorgosK closed 5 years ago

GiorgosK commented 6 years ago

I have installed composer globally

composer global require grasmash/composerize-drupal

and inside the project directory trying to composerize I get following error

composer composerize-drupal --composer-root=. --drupal-root=.Created composer.json

[ErrorException]
Undefined offset: 1

composerize-drupal [--composer-root COMPOSER-ROOT] [--drupal-root DRUPAL-ROOT] [--exact-versions] [--no-update]

I have also deleted the existing composer.json and .lock files and rerun but still get same error

jbfulgencio commented 6 years ago

This issue happens when there's no version info on file info.yml of the module. I think the best approach here is to create a exception giving the user the name of the invalid modules.

Alexj12 commented 6 years ago

I ran into this issue today so opened a PR with a fairly simple check for invalid versions and an exception that lists modules with bad versions.

https://github.com/grasmash/composerize-drupal/pull/8

grasmash commented 5 years ago

Resolved in https://github.com/grasmash/composerize-drupal/commit/0fdd38ffee99373ceb32df91c9c8f5e4106b1c68