Unable to determine branch version from
- moosh version: lastest
- moodle version: 3.10
- database: MariaDB
- php version: 7.4
- operating system: Centos
Actual behaviour
when running the moosh command: `[root@hostone moosh]# moosh
Fatal error: Uncaught Exception: Unable to determine branch version from '/home/pacificoschool/public_html/version.php' in /home/castillodelrey/public_html/moosh/includes/functions.php:147 Stack trace: #0 /home/castillodelrey/public_html/moosh/moosh.php(74): moosh_moodle_version('/home/pacificos...') #1 {main} thrown in /home/castillodelrey/public_html/moosh/includes/functions.php on line 147 `
Expected behaviour
That the command is recognized in the terminal
Steps to reproduce
- install moosh form git on path moodle 3.10
- execute command moosh in terminal
Hello. Same problem here, but mosh installed from packages
- moosh version: lastest
- moodle version: 3.11
- database: MySQL 5.7.34-0ubuntu0.18.04.1
- php version: 7.3.29-1+ubuntu18.04.1+deb.sury.org+1
- operating system: Ubuntu 18.04
Seems that problems, is , again #343 the regexp used when try to extract moodle version.
A quick fix that I made (to verify, test and etc) :
moosh/includes/functions.php, Line 141
if (preg_match('/^\$branch\s+=\s+\'(\d\d\d)\'.*/', $line, $matches)) {
I had added an additional \d, but i guess a better aproach could be use
^\$branch\s+=\s+\'(\d+)\'.*