Skip to content

Commit

Permalink
Change config name to hidden .bemy.json
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rmat1k committed Apr 4, 2015
1 parent 9526c9c commit 4879872
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ bemy c j
Result: called 'create' task and appear `some-block/some-block.css` and `some-block/some-block.js`.

#### Options
`-o` — to open the file after creation. This command configured in `bemy.json` in section `editor-open-command`. Default value is `wstorm {{file-path}}:{{line-number}}`. See more details at below in section `Configuring`.;
`-p [file list]` — file types list. Available following file types: `-p "css js deps priv bh"`. Also you can use short notation `p c j b d`. You can add you own file types and shortcuts into `bemy.json`. Also you can set file types with just enumeration before single options keys, e.g. `bemy c j -o -g`.
`-o` — to open the file after creation. This command configured in `.bemy.json` in section `editor-open-command`. Default value is `wstorm {{file-path}}:{{line-number}}`. See more details at below in section `Configuring`.;
`-p [file list]` — file types list. Available following file types: `-p "css js deps priv bh"`. Also you can use short notation `p c j b d`. You can add you own file types and shortcuts into `.bemy.json`. Also you can set file types with just enumeration before single options keys, e.g. `bemy c j -o -g`.

Webstorm is required `-f [path]`. An example of using bemy with `external tools` of webstorm for the task of creation:
![](https://cloud.githubusercontent.com/assets/769992/6725632/0232f4ee-ce2e-11e4-942e-7845381663ed.png)
Expand All @@ -61,8 +61,8 @@ Webstorm is required `-f [path]`. An example of using bemy with `external tools`

### The autotask
Call default action depend on BEM node. Currently work following variants:
1. If target is deps-file, creates described elems\mods\elemMods folder structure. And depend on options of `bemy.json` also creates elems\mods\elemMods files. By default it's css files. Se `Configuring` section for more details.
2. Otherwise call create task with default options (equal `-t create -f [path] -p "css"`). Default file types for autotask configurable at `bemy.json`.
1. If target is deps-file, creates described elems\mods\elemMods folder structure. And depend on options of `.bemy.json` also creates elems\mods\elemMods files. By default it's css files. Se `Configuring` section for more details.
2. Otherwise call create task with default options (equal `-t create -f [path] -p "css"`). Default file types for autotask configurable at `.bemy.json`.

#### CLI for autotask
`bemy -f [path]`
Expand All @@ -81,7 +81,7 @@ Webstorm is required `-f [path]`. An example of using bemy with `external tools`
Don't forget to configure hotkey for task running (e.g. `ctrl + a`) at `keymap` section.

### Confguring
Bemy will try to find bemy.json on the every previous level (like npm) until the root directory, so you can put `bemy.json` into your home directory or project directory if you need different options depend on project. Otherwise bemy wil take `bemy.json` from own directory.
Bemy will try to find `.bemy.json` on the every previous level (like npm) until the root directory, so you can put `.bemy.json` into your home directory or project directory if you need different options depend on project. Otherwise bemy wil take `.bemy.json` from own directory.

#### `file-types`
Description of the used file types.
Expand Down
4 changes: 2 additions & 2 deletions bemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ function getConfig(ownConfig){
if (ownConfig) {
configPath = path.resolve(ownConfig);
} else {
configPath = getConfigPath(path.dirname(trgPath)) || path.join(__dirname, 'bemy.json');
configPath = getConfigPath(path.dirname(trgPath)) || path.join(__dirname, '.bemy.json');
}

if (isDebug) console.log('Config path: ' + configPath);
Expand All @@ -434,7 +434,7 @@ function getConfig(ownConfig){
function getConfigPath(dir) {
if (dir === '/') return;

var checkPath = path.resolve(dir, 'bemy.json');
var checkPath = path.resolve(dir, '.bemy.json');
if (fs.existsSync(checkPath)) {
return checkPath;
} else {
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.0.1",
"version": "3.0.2",
"keywords": [
"bem",
"BEM Tools"
Expand Down

0 comments on commit 4879872

Please sign in to comment.