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

Plugin generator doesn't work #53

Open
damianhodgkiss opened this issue Apr 7, 2014 · 1 comment
Open

Plugin generator doesn't work #53

damianhodgkiss opened this issue Apr 7, 2014 · 1 comment

Comments

@damianhodgkiss
Copy link

OSX 10.9
Damian$ npm -v
1.3.21
Damian$ yo -v
1.1.2
Damian$ node -v
v0.10.24
Damian$ yo yo-wordpress:plugin
[?] Name of the plugin: myPlugin
[?] Author Name: me

/usr/local/share/npm/lib/node_modules/generator-yo-wordpress/plugin/index.js:78
        if (err) throw err
                       ^
Error: ENOENT, open 'app/wp-content/plugins/myPlugin/myPlugin.php'

The main issue is the fs.rename()'s dont check the err callback, which does contain an error. I have tried to fix it but without success so I wondered if it is only my system or if it works for others. The first fs.rename seems redundant as the remote.directory() call earlier on put the plugin in the correct directory already but the second fs.rename fails still anyway.

Patching editFiles with return cb() to trigger an immediate return and see the paths created:

   create app/wp-content/plugins/myPlugin/LICENSE.txt
   create app/wp-content/plugins/myPlugin/README.txt
   create app/wp-content/plugins/myPlugin/admin/assets/css/admin.css
   create app/wp-content/plugins/myPlugin/admin/assets/css/index.php
   create app/wp-content/plugins/myPlugin/admin/assets/js/admin.js
   create app/wp-content/plugins/myPlugin/admin/assets/js/index.php
   create app/wp-content/plugins/myPlugin/admin/class-plugin-name-admin.php
   create app/wp-content/plugins/myPlugin/admin/includes/index.php
   create app/wp-content/plugins/myPlugin/admin/views/admin.php
   create app/wp-content/plugins/myPlugin/admin/views/index.php
   create app/wp-content/plugins/myPlugin/assets/banner-1544x500.png
   create app/wp-content/plugins/myPlugin/assets/banner-772x250.png
   create app/wp-content/plugins/myPlugin/assets/index.php
   create app/wp-content/plugins/myPlugin/assets/screenshot-1.png
   create app/wp-content/plugins/myPlugin/includes/index.php
   create app/wp-content/plugins/myPlugin/index.php
   create app/wp-content/plugins/myPlugin/languages/index.php
   create app/wp-content/plugins/myPlugin/languages/plugin-name.pot
   create app/wp-content/plugins/myPlugin/plugin-name.php
   create app/wp-content/plugins/myPlugin/public/assets/css/index.php
   create app/wp-content/plugins/myPlugin/public/assets/css/public.css
   create app/wp-content/plugins/myPlugin/public/assets/index.php
   create app/wp-content/plugins/myPlugin/public/assets/js/index.php
   create app/wp-content/plugins/myPlugin/public/assets/js/public.js
   create app/wp-content/plugins/myPlugin/public/class-plugin-name.php
   create app/wp-content/plugins/myPlugin/public/includes/index.php
   create app/wp-content/plugins/myPlugin/public/views/index.php
   create app/wp-content/plugins/myPlugin/public/views/public.php
   create app/wp-content/plugins/myPlugin/uninstall.php
@romainberger
Copy link
Owner

This is probably caused by the plugin boilerplate structure that changed. It already happened in #47, I'll try to take a look soon.

borisaguilar added a commit to borisaguilar/yeoman-wordpress that referenced this issue Apr 30, 2014
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

2 participants