Skip to content

Commit

Permalink
making it work for now
Browse files Browse the repository at this point in the history
  • Loading branch information
sepans committed Mar 12, 2015
1 parent 403c389 commit 3ca68b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion rename/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var ThelmaGenerator = yeoman.generators.Base.extend({
name: 'customReplace',
type: 'input',
message: 'Any blind string replace? (e.g. str1:str1New,str2:str2New)',
default: 'th-data-utility:lens-u-data-utility,th-u-data-selector:lens-u-data-selector,th-container:lens-container'
default: 'th-data-utility:lens-u-data-utility,th-u-data-selector:lens-u-data-selector,th-container:lens-container,thelmanews.github.io:lenses.github.io'
}];

this.prompt(prompts, function (props) {
Expand All @@ -93,6 +93,8 @@ var ThelmaGenerator = yeoman.generators.Base.extend({

// this.sourceRoot(this.elementName);
// this.destinationRoot(this.elementName);
//
//var done = this.async();


var newPathPrefix = this.newElementName+'/',
Expand All @@ -109,6 +111,7 @@ var ThelmaGenerator = yeoman.generators.Base.extend({

{src: 'test/index.html', dest: 'test/index.html', checkContent: true},
{src: 'test/'+this.elementName+'.html', dest: 'test/'+this.newElementName+'.html', checkContent: true},
{src: 'test/'+this.elementName+'-basic.html', dest: 'test/'+this.newElementName+'-basic.html', checkContent: true},
];

fileList.forEach(function(fileItem) {
Expand All @@ -128,6 +131,10 @@ var ThelmaGenerator = yeoman.generators.Base.extend({

var newContent = contentStr.replace(re, this.newElementName);

if(fileItem.src==='bower.json' || fileItem.src==='metadata.html') {
newContent = newContent.replace('thelma,','lenses,');
}

this.replaceItems.forEach(function(replaceItem) {
var itemRe = new RegExp(replaceItem.from,'g');
newContent = newContent.replace(itemRe, replaceItem.to);
Expand All @@ -154,11 +161,17 @@ var ThelmaGenerator = yeoman.generators.Base.extend({
}.bind(this));


// done();




},

gh: function () {

/*
var done = this.async();
var src = this.sourceRoot();//path.join(__dirname, '');
var dest = this.destinationRoot();//path.join(process.cwd());//, 'tmp-' + Date.now());
Expand Down Expand Up @@ -187,10 +200,17 @@ var ThelmaGenerator = yeoman.generators.Base.extend({
done();
}.bind(this));
}.bind(this));
*/


}






});


Expand Down
2 changes: 1 addition & 1 deletion rename/templates/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ git rm test/$oldName.html

git commit . -m 'renaming'

git push origin lens-rename
#git push origin lens-rename

0 comments on commit 3ca68b7

Please sign in to comment.