endroid / installer

Composer plugin for installing package configuration files

Home Page:https://endroid.nl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modify .env / .gitignore, composer.json

tacman opened this issue · comments

In the blog post, you mention

 [WIP] Add sections to files like .env and .gitignore

Any chance you could add that, even something simple like "append these lines to this file".

I don't know if it's possible, but I'd also like the ability to add a command to the scripts section of composer.json. I think the Symfony recipes allow that, symfony/asset-mapper adds a line to install the assets (bin/console importmap:install). I have a bundle that uses the js routing bundle, and I'd like my install to tweak composer.json

    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd",
            "fos:js-routing:dump --format=js --target=public/js/fos_js_routes.js --callback=\"export default  \"": "symfony-cmd",
            "importmap:install": "symfony-cmd"
        },

I know this is more complicated, and there's probably some jq way of doing it. But it seems like appending lines to .env and .gitignore would be relatively easy.

Thanks again for this package.

Hi @tacman that feature never made it unfortunately and if I build it it has to be a solution that uses proper placeholder and detection if something was added already. So currently if you really need those features I think you are better off using Flex.