Closed drbroad closed 11 years ago
I am not able to replicate this. Could you paste in the settings you used (the portion between the red lines when it asks for confirmation)? Also, it might help to add a console.log
where it is saying the error is to see what the contents
variable is holding. If you do that, please also copy in that output. And thanks for using YeoPress, hopefully I can get this figured out for you.
A Yeoman Generator For WordPress
[?] URL WordPress will be installed at (ex. example.com): dev.yeopress.com
[?] WordPress Version: (3.5.1)
[?] Table prefix: (wp_) yo_
[?] Database host: (localhost)
[?] Database name: wp_yo
[?] Database user: root
[?] Database password: yeopress
[?] Use Git? (Y)
[?] Would you like to install WordPress as a submodule? (N) y
[?] WordPress install directory: (wordpress)
[?] WordPress content directory: (content)
[?] Install a custom theme? (Y) y
[?] Destination directory (ex. twentytwelve): yeopress
[?] Theme source type (git/tar): (git)
[?] GitHub username: (wesleytodd)
[?] GitHub repository name: (YeoPress)
[?] Repository branch: (template)
----------------------------
WordPress URL: http://dev.yeopress.com
Database table prefix: yo_
Database host: localhost
Database name: wp_yo
Database user: root
Database password: yeopress
WordPress install directory: wordpress
WordPress content directory: content
Initialize a Git repo: Yes
Install WordPress as a Git submodule: Yes
Theme install directory: content/themes/yeopress
----------------------------
[?] Does everything look correct? (Y)
And the console.log shows this in iterm2:
create content/themes/twentytwelve/page.php
create content/themes/twentytwelve/rtl.css
create content/themes/twentytwelve/screenshot.png
create content/themes/twentytwelve/search.php
create content/themes/twentytwelve/sidebar-front.php
create content/themes/twentytwelve/sidebar.php
create content/themes/twentytwelve/single.php
create content/themes/twentytwelve/style.css
create content/themes/twentytwelve/tag.php
create wp-config.php
<Buffer 3c 3f 70 68 70 0a 2f 2a 2a 0a 20 2a 20 54 68 65 20 62 61 73 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 73 20 6f 66 20 74 68 65 20 57 6f 72 64 50 72 65 ...>
/usr/local/lib/node_modules/generator-wordpress/util/wordpress.js:82
db.name = contents.match(/define\(["']DB_NAME["'],[\s]*["'](.*)["']\)/)[1]
^
TypeError: Object <?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
in wordpress.js:
function getDbCredentials() {
var ee = new EventEmitter();
loadConfig().on('done', function(contents) {
console.log(contents)
var db = {};
db.name = contents.match(/define\(["']DB_NAME["'],[\s]*["'](.*)["']\)/)[1];
db.user = contents.match(/define\(["']DB_USER["'],[\s]*["'](.*)["']\)/)[1];
db.pass = contents.match(/define\(["']DB_PASSWORD["'],[\s]*["'](.*)["']\)/)[1];
db.host = contents.match(/define\(["']DB_HOST["'],[\s]*["'](.*)["']\)/)[1];
db.prefix = contents.match(/\$table_prefix[\s]*=[\s]*["'](.*)["']/)[1];
ee.emit('done', db);
}).on('error', function(err) {
ee.emit('error', err);
});
return ee;
};
Appreciate the help!
Which version of node are you using ($ node -v
)? I am not having this issue on 0.10.*, but I know exactly what it happening and can push a fix out tonight, I will update here when it is published. Sorry for your issue.
I believe i was using 0.9.6 but just performed a round of uninstalls/reinstalls to make sure nothing fishy was happening. I am on 0.10.12 now and all is well with the generator.
I am glad it is working well now. I have not been making backward compatibility a priority, but I don't think it matters much for generator users. Also, in case you don't know, odd number releases are unstable (0.9., 0.11.), so you should be careful of using them for anything other than testing.
First up - love the generator. Just experiencing some minor trouble with installing a theme (any theme)
Event with the defaults selected in the generator it seems to die directly after creating wp-config.php.
And thats where it dies... Any thoughts?