Last active
April 11, 2020 03:40
-
-
Save saravanak/8f0a158d5727435fdda9c6ea680925e8 to your computer and use it in GitHub Desktop.
Use component colocation Since Ember 3.13.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to be executed in the root directory of an Ember project. | |
# What: After working on an Ember codebase with pod structure, I found it intuitive to use co-located components. | |
# Since Ember 3.13, we have support for component co-location. | |
# This script moves all component templates to their respective component locations. | |
# YMMV: | |
# 1. Leaves empty directories on the `templates` folder | |
# 2. Close your project files in the editor before doing this. | |
# 3. You are using SCM, and you've committed/stashed your changes right ? | |
for file in `find app/templates/components -type f` | |
do | |
component_location=$(echo $file | sed 's/templates\///') | |
mv $file $component_location | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment