From 4879872f5f0645784b0f8b9621cdef5cb07081c3 Mon Sep 17 00:00:00 2001 From: Anton Grischenko Date: Sat, 4 Apr 2015 17:11:22 +0500 Subject: [PATCH] Change config name to hidden .bemy.json --- bemy.json => .bemy.json | 0 README.md | 10 +++++----- bemy.js | 4 ++-- package.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename bemy.json => .bemy.json (100%) diff --git a/bemy.json b/.bemy.json similarity index 100% rename from bemy.json rename to .bemy.json diff --git a/README.md b/README.md index 29d0fe9..eb68b26 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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]` @@ -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. diff --git a/bemy.js b/bemy.js index aa9ff73..b9fc98e 100644 --- a/bemy.js +++ b/bemy.js @@ -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); @@ -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 { diff --git a/package.json b/package.json index 159084c..dfad692 100644 --- a/package.json +++ b/package.json @@ -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"