Skip to content

Commit

Permalink
New option "auto_dir"
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rmat1k committed Feb 7, 2016
1 parent c97636f commit 6a3d8ed
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .bemy.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"deps_task": {
"files": [ "css" ]
},
"auto_dir": [ "css" ],
"debug": false,
"checkForUpdate": true
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
temp/
.idea
demo/
atlassian-ide-plugin.xml

.DS_Store
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ For example, default css template contain:
#### `deps_task`
Options for autotask when it called on deps file. `files` – list of file types to be created in addition to folders.

#### `auto_dir`
Options for autotask when it called on directory. It set needed file types, which will be created. Default is `['css']`.

#### `editor-open-command`
Command to be called after creating the file. There are two placeholders:
1. `{{file-path}}` to be replaced with relevant file path.
Expand Down
6 changes: 5 additions & 1 deletion bemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ function normalizeFileTypes(fileTypes){

function startCreating(fileTypes){
if (!fileTypes || fileTypes.length === 0) {
fileTypes = ['css']
if (config.auto_dir && !Array.isArray(config.auto_dir)) {
throw new Error('Wrong config param "auto_dir". Must be an array.')
}

fileTypes = config.auto_dir || ['css']
} else {
fileTypes = normalizeFileTypes(fileTypes);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/f0rmat1k/bemy.git"
},
"version": "3.5.6",
"version": "3.6.0",
"keywords": [
"bem",
"BEM Tools"
Expand Down

0 comments on commit 6a3d8ed

Please sign in to comment.