laroute icon indicating copy to clipboard operation
laroute copied to clipboard

Template laroute.js not found when executing laroute:generate from outside the base application install folder

Open percymamedy opened this issue 7 years ago • 2 comments

I am using deployer to deploy my site to production. One of the tasks I defined was as follows

task('artisan:laroute:generate', function () {
    run('{{bin/php}} {{release_path}}/artisan laroute:generate');
});

However I get the following error when deploying:

Executing task artisan:laroute:generate
[mysite.com] > /usr/local/bin/php ~/releases/12/artisan laroute:generate
[mysite.com] < stdin: is not a tty
[mysite.com] < File does not exist at path vendor/lord/laroute/src/templates/laroute.js

When running the command manually on the server it works.

Any ideas ?

percymamedy avatar Jan 19 '18 19:01 percymamedy

Did you do it after the composer install?

martdegraaf avatar Jan 20 '18 13:01 martdegraaf

I actually found the issue was that when executing artisan from outside the base install folder the path of the template files could not be resolved.

For example if my application was installed in /var/www and I was in /var trying to execute php artisan like so :

$ /var: php www/artisan laroute:generate 

The path defined in config laroute.php broke down and could not be resolved since it was looking in the /var folder.

This PR should get it fixed : https://github.com/aaronlord/laroute/pull/81

percymamedy avatar Jan 21 '18 07:01 percymamedy