bulk sass-convert
Used this to run sass-convert over a folder of scss files and bring them to the indented syntax
for file in `ls *.scss`;
do
n="$(echo $file | sed 's/^\(.*\).scss$/\1.sass/')";
sass-convert $file $n;
rm $file;
done
Written by Tyler Lee
Related protips
2 Responses
If you want to find all files within the folder structure you are currently at (i.e. all files within subfolders) and convert them all, you can do this:
for file in $(find ./ -name ".sass"); do n="$(echo $file | sed 's/^(.).sass$/\1.scss/')"; sass-convert $file $n; rm $file; done
Please note that this will find and convert sass to scss (because that is what I wanted to do) so to convert the other way round you just change all sass to scss and vice versa.
Cheers!
over 1 year ago
·
The sed pattern fails due to unescaped braces. I ended up with this:
for file in $(find ./ -name "*.scss");
do n="$(echo $file | sed 's/.scss$/.sass/')";
sass-convert $file $n;
rm $file;
done
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sass
Authors
Related Tags
#sass
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#