Skip to content

Commit

Permalink
Возможность выбирать в качестве пути файлы при вызове задачи создания
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rmat1k committed Mar 5, 2015
1 parent 68ae568 commit b0a35d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions bemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ var BEM_INFO = bemInfo(trgPath),
var task = options.t || 'auto';
tasks[task]();

function valdateBemName(name){
return !/[^-a-z0-9]/ig.test(name);
}

function startCreating(fileTypes){
return fileTypes.forEach(function(fileType){
createFileFromTemplate(fileType);
Expand Down Expand Up @@ -127,12 +123,11 @@ function createFile(file, type, trg, modVal){
trg = trg || trgPath;
modVal = modVal || '';

var info = bemInfo(trg),
p = path.join(trg, info.bemName + modVal + SUFFIXES[type]);
if (BEM_INFO.isFile) trg = path.dirname(trg);

if (!fs.existsSync(p)) {
fs.writeFileSync(p, file);
}
var p = path.join(trg, BEM_INFO.bemName + modVal + SUFFIXES[type]);

if (!fs.existsSync(p)) fs.writeFileSync(p, file);

if (options.g) gitAddTrg(trg, p);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "git",
"url": "https://github.com/f0rmat1k/bemy.git"
},
"version": "1.3.0",
"version": "1.3.1",
"keywords": [
"bem",
"BEM Tools"
Expand Down

0 comments on commit b0a35d7

Please sign in to comment.