Skip to content

Executing post-install-cmd commands from composer.json #2

@adamgoose

Description

@adamgoose

The default composer.json provided by laravel has the following scripts:

"scripts": {
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },

However, php is not available, thus the push fails. I tried using $BUILD_DIR/bin/php, since that's what you use in the compile script to execute composer, however apparently $BUILD_DIR is empty when composer executes these functions because I receive the following error messages.

sh: /bin/php: not found
Script $BUILD_DIR/bin/php artisan optimize handling the post-install-cmd event returned with an error

How might I go about modifying the composer.json provided by Laravel so that it can successfully execute artisan commands via the json file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions