Created
May 7, 2016 18:20
-
-
Save reyhansofian/e07b4c1dc1e2fd0c0bf3c662e17809dd to your computer and use it in GitHub Desktop.
Create folder based on JSX files and move JSX file to the created folder
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 | |
for file in *.jsx; do | |
dir=${file%.js*} | |
if [ -e $dir ]; then | |
mv "$file" "$dir" | |
else | |
mkdir -p "$dir" | |
mv "$file" "$dir" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment