Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid yaml files left after bundle removal. #10

Open
ianef opened this issue Sep 17, 2024 · 0 comments
Open

Invalid yaml files left after bundle removal. #10

ianef opened this issue Sep 17, 2024 · 0 comments

Comments

@ianef
Copy link

ianef commented Sep 17, 2024

If I create say a routing yaml file in the config directory of the parent project, it's created and works OK. However when my bundle is removed if doesn't remove all of the file contents and leaves invalid yaml.

Here are the contents of my cook.yaml file. It updates the parent project bundles.php and adds a bundle specific routing file.

files:
    '%CONFIG_DIR%/bundles.php':
        type: php_array
        entries:
            Xact\OPCacheDashboard\XactOPCacheDashboardBundle:
                dev: true
                test: true
        filters:
            keys: [class_constant]
            values: [single_line_array]

    '%CONFIG_DIR%/routes/xact_opcache_dashboard.yaml':
        type: yaml
        content: |
            xact_opcache_dashboard:
                resource: "@XactOPCacheDashboardBundle/config/routes.yaml"

This creates a ./config/routes/xact_opcache_dashboard.yaml in the parent project as follows:

xact_opcache_dashboard:
###> xactsystems/opcache-dashboard ###
    resource: "@XactOPCacheDashboardBundle/config/routes.yaml"
###< xactsystems/opcache-dashboard ###

Notice that the surrounding quotes do not include the initial label.

When the bundle is removed, only the contents in my config file that are within the comments section get removed. This leaves an invalid label that has no content and causes errors:

xact_opcache_dashboard:

This results in:

The definition of "xact_opcache_dashboard" in ".../config/routes/xact_opcache_dashboard.yaml" must be a YAML array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant