-
Notifications
You must be signed in to change notification settings - Fork 72
bem mv command #317
Comments
Maybe |
@narqo I was thinking that |
Agreed with @narqo. "move" is more intuitive and shorter for renaming. bem move --to-level=another mb? |
# rename block__elem1 to block__elem2
bem mv block__elem1 __elem2
# make block2 from block1__elem
bem mv block1__elem block2 --recursive
# rename block1 to block2
bem mv block1 block2
# rename block1 to block2 (with all its contents)
bem mv block1 block2 --recursive
# rename block1 to block2 at levels common.blocks and desktop.blocks
bem mv --level common.blocks --level desktop.blocks block1 block2
# move block from desktop.blocks level to common.blocks level
bem mv --from desktop.blocks --to common.blocks block
# move block (and all its contents) from desktop.blocks level to common.blocks level
bem mv --from desktop.blocks -to common.blocks block --recursive Provide another cases please. |
Shortcuts like
|
@arikon oops, sorry. Missed this Sergey Belov [email protected] wrote:
|
@arikon are you working on this already? |
@bariscicek I've started and then postponed my work |
@arikon Maybe you can share your code so I can continue working on this issue? |
I'll push it later today! 30.03.2013, 00:55, "Baris Cicek" [email protected]:
Отправлено из мобильной Яндекс.Почты: http://m.ya.ru/ymail |
@arikon cool thanks. |
@bariscicek Just pushed |
@arikon I just started working on the branch. I haven't committed anything, but first Ineed to clarify some stuff since it might be related with design decisions. Now on copying the entities my major question is this. Is it valid to have an empty directory on source levels? There are cases that you might leave the empty directory if you specify a tech file. Or move command should remove all the empty directories left behind. (my idea is to check directories of source files and if htye are empty remove them). an example can be
In that case Basically it relies on if an empty directoy in BEM tree has any meaning. If there's no meaning at all, I believe it's better to clean the empty directories that would prevent clutter in the development environment. Once implementing the move function, I"ll fix the change tech. Then it's better to brainstorm about the contents of the files. A basic replace would be fine but it might also break files. Maybe there should be a git-type of conflict or approve question before applying replace bem entity names. I remember I read a similar proposal on yandex club discussion over the topic, but could not understand very well. (limited pa-ruskiy over here.) |
@arikon I need more info about BEM entity changes. First of all what's the point? I don't see any use case. Second, how it could be possible? For example for a tree I think it's not necessary to change BEM entity types. But we should discuss about the refactoring of files using the |
* Adds getSelector() to tech.js to change content of target file * Support changing tech of BEM entities * Couple of fixes to previous patch
Ok with recent patch, I'll be waiting for you to check. This includes content change as well which is pretty useful. |
@bariscicek Sorry for the delay. Could you please open pull request for this? |
@arikon Np bro. Let's talk about it ;-) Don't merge it btw. It should be refactored asap. |
Implement
bem mv
command.See blog post for opinions on command line interface:
http://clubs.ya.ru/bem/replies.xml?item_no=2066
The text was updated successfully, but these errors were encountered: