Skip to content

Commit 4f14091

Browse files
authored
fix sqlite drop-in install if skip-content enabled (#52)
1 parent a545585 commit 4f14091

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

features/valet-new.feature

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,22 @@ Feature: Create a new install.
8383
Success: app.{PROJECT} ready! https://app.{PROJECT}.dev
8484
"""
8585
And the wp_app_{PROJECT} database should exist
86+
87+
@issue-51
88+
Scenario: skip-content is compatible with using sqlite for the DB.
89+
Given an empty directory
90+
And a wp-cli.yml file:
91+
"""
92+
core download:
93+
skip-content: true
94+
"""
95+
And a random project name as {PROJECT}
96+
When I run `wp valet new {PROJECT} --db=sqlite`
97+
Then the {PROJECT}/wp-config.php file should exist
98+
And the {PROJECT}/wp-content/db.php file should exist
99+
And the wp_{PROJECT} database should not exist
100+
And STDOUT should contain:
101+
"""
102+
Success: {PROJECT} ready! https://{PROJECT}.dev
103+
"""
104+

src/Installer/WordPressInstaller.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ protected function installSqliteIntegration()
144144
}
145145
}
146146

147+
// Ensure wp-content directory exists as it will not
148+
// if skip-content is passed.
149+
if (! is_dir($this->contentPath())) {
150+
mkdir($this->contentPath(), 0755, true);
151+
}
152+
147153
$cache->export($cache_key, $this->contentPath('db.php'));
148154
}
149155

0 commit comments

Comments
 (0)