Skip to content

Instantly share code, notes, and snippets.

@knowuh
Created September 2, 2011 20:03
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save knowuh/1189728 to your computer and use it in GitHub Desktop.
Save knowuh/1189728 to your computer and use it in GitHub Desktop.
convert sass to scss by example
#convert .sass files to scss files:
bundle exec sass-convert -R --from sass --to scss ./public/stylesheets/sass/
# delete the old sass files:
find ./public/stylesheets/sass -name "*.sass" | xargs rm
# rename the directory.
mv ./public/stylesheets/sass ./public/stylesheets/scss
# replace local @imports what include the .sass extension
find ./public/stylesheets/scss -name "*.scss" | xargs sed -i "" 's/\.sass//g'
#ensure that we got them all
grep -R "@import" ./public/stylesheets/scss
bundle exec compass compile \
--sass-dir public/stylesheets/scss/ --css-dir public stylesheets/
@hypeJunction
Copy link

hypeJunction commented Oct 28, 2017

Line 12 was causing problems for me, I changed it to:
find ./public/stylesheets/scss -name "*.scss" | xargs sed -i 's/\.sass//g'

@hypeJunction
Copy link

Instead of moving and deleting you can also use:
bundle exec sass-convert -R --from sass --to scss ./public/stylesheets/sass/ ./public/stylesheets/scss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment