OzzyCzech / potrans

Command line tool for translate Gettext with Google Translator API or DeepL API
MIT License
90 stars 30 forks source link

Invalid path to autoload.php #10

Closed quinncomendant closed 3 years ago

quinncomendant commented 3 years ago

I've installed potrans with composer require --dev om/potrans:dev-master, and it installed to my project's vendor directory at ./lib/vendor/om/potrans/. When I run ./lib/vendor/om/potrans/bin/potrans it throws the following errors because it is unable to find the autoload.php script:

Warning: require_once(/Users/me/src/lda-prenotare/lib/vendor/om/potrans/src/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/q/src/lda-prenotare/lib/vendor/om/potrans/src/potranscli.php on line 12

Fatal error: require_once(): Failed opening required '/Users/me/src/lda-prenotare/lib/vendor/om/potrans/src/../vendor/autoload.php' (include_path='.') in /Users/me/src/lda-prenotare/lib/vendor/om/potrans/src/potranscli.php on line 12

The path to my composer autoload.php file is ./lib/vendor/autoload.php.

The fix would be to change line 12 in om/potrans/src/potranscli.php from:

require_once __DIR__ . '/../vendor/autoload.php';

to:

require_once __DIR__ . '/../../../autoload.php';