From b9d251d21a34295252a848bcaf19fff7de518a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Aramis=20Aguilar=20Rodr=C3=ADguez?= Date: Wed, 30 Apr 2014 09:02:14 -0600 Subject: [PATCH] Generator Plugin rename fix Fixes for issue https://github.com/romainberger/yeoman-wordpress/issues/53 --- plugin/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugin/index.js b/plugin/index.js index 67a3f0a..ac50732 100644 --- a/plugin/index.js +++ b/plugin/index.js @@ -1,4 +1,3 @@ - 'use strict'; var util = require('util') @@ -69,11 +68,8 @@ Generator.prototype.createPlugin = function createPlugin() { Generator.prototype.editFiles = function editFiles() { var cb = this.async() , self = this - - fs.rename('app/wp-content/plugins/plugin-name', 'app/wp-content/plugins/'+self.safeName, function() { fs.rename('app/wp-content/plugins/'+self.safeName+'/plugin-name.php', 'app/wp-content/plugins/'+self.safeName+'/'+self.safeName+'.php', function() { var pluginFile = 'app/wp-content/plugins/'+self.safeName+'/'+self.safeName+'.php' - fs.readFile(pluginFile, 'utf8', function(err, data) { if (err) throw err @@ -82,8 +78,7 @@ Generator.prototype.editFiles = function editFiles() { fs.writeFile(pluginFile, data) fs.unlink('app/wp-content/plugins/README.md', function() { - cb() - }) + cb() }) }) })