modmore / Gitify

Command line toolkit to make managing a MODX site in git a lot easier.
MIT License
122 stars 55 forks source link

Unable to run Gitify 1.0 #375

Closed hugopeek closed 3 years ago

hugopeek commented 3 years ago

Summary

First of all: thanks Mark and everyone involved for shipping the long awaited verion 1! Unfortunately, I can't get it to run out of the box..

Step to reproduce

I followed the exact installation steps and ran ./Gitify.

Observed behavior

It threw the following error:

❯ ./Gitify                                                     
PHP Notice:  Undefined index: version in /home/hugo/Localhost/dev/gitify-v1/application.php on line 75
PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Symfony\Component\Console\Application::__construct() must be of the type string, null given, called in /home/hugo/Localhost/dev/gitify-v1/application.php on line 77 and defined in /home/hugo/Localhost/dev/gitify-v1/vendor/symfony/console/Application.php:87
Stack trace:
#0 /home/hugo/Localhost/dev/gitify-v1/application.php(77): Symfony\Component\Console\Application->__construct()
#1 /home/hugo/Localhost/dev/gitify-v1/Gitify(15): include('/home/hugo/Loca...')
#2 {main}
  thrown in /home/hugo/Localhost/dev/gitify-v1/vendor/symfony/console/Application.php on line 87

Expected behavior

It should show the Gitify help section.

Environment

Gitify master branch Debian 11 PHP 7.4 / MariaDB 10.5

This was the output of the installation command:

❯ composer install --no-dev                                                  
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 14 installs, 0 updates, 0 removals
  - Syncing kbjr/git.php (0.2.0) into cache
  - Installing kbjr/git.php (0.2.0): Cloning master from cache
  - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing symfony/string (v5.3.7): Extracting archive
  - Installing psr/container (1.1.1): Extracting archive
  - Installing symfony/service-contracts (v2.4.0): Extracting archive
  - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
  - Installing symfony/deprecation-contracts (v2.4.0): Extracting archive
  - Installing symfony/console (v5.3.7): Extracting archive
  - Installing symfony/process (v5.3.7): Extracting archive
  - Installing symfony/yaml (v5.3.6): Extracting archive
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
hugopeek commented 3 years ago

Ah, removing the $version variable on line 77 in application.php fixes it. But it's obviously unable to display the version number on line 1 of the output.

Mark-H commented 3 years ago

Technically 1.0 shipped two years ago, I only turned it into a release on GitHub yesterday. Murray's working on V2 right now.

I didn't realize the version was being read from the composer file 🙈 that needs to come from somewhere else, as in the composer file it breaks packagist if it doesn't match a tag.

Mark-H commented 3 years ago

Fixed in 1.1.2 81fa7dc2a6fe87bf45d016475ea386535fbf4651

And also in dev-master for 2.0