andrewjmead / wpsites

A CLI for quickly spinning up WordPress sites
MIT License
17 stars 1 forks source link

Ability to override "sites_directory" path in templates #24

Open slaFFik opened 5 days ago

slaFFik commented 5 days ago

In my ~/Projects directory, I have subdirs for personal projects, work-related projects, experiments, etc.

So for testing, I may need to spin up a site in ~/Projects/work/example-one/ or ~/Projects/personal/example-two/ depending on the template (work-related or personal one).

So here is what I would like to have:

return [
    'sites_directory' => '$HOME/Projects/random',
    'templates' => [
        [
            'name'              => 'Work Test Site,
            'sites_directory'   => '$HOME/Projects/work`,
            'wordpress_version' => '6.0',
            'plugins'           => [
                'wpforms-lite',
            ],
            'theme' => 'twentytwentyfour'
        ],
        [
            'name'              => 'Personal Test Site,
            'sites_directory'   => '$HOME/Projects/personal`,
            'wordpress_version' => 'latest',
            'plugins'           => [
                'commentswp',
            ],
            'theme' => 'ollie'
        ],
    ],
];

Is that something that is possible with your tool?

andrewjmead commented 5 days ago

Love it. I'll get this in the next release.

andrewjmead commented 5 days ago

I'm thinking of removing sites_directory as a top-level property.

Instead, it'll work like all other options where there is a default and then templates can choose to override that default. It'll be site_directory.

slaFFik commented 4 days ago

@andrewjmead Sounds good!