Created
June 12, 2016 12:37
-
-
Save takumiio/f6bd8dc4aec7f34886df793195d5f2b1 to your computer and use it in GitHub Desktop.
Railsにless.jsを組み込むのをワンライナーでできるようにした。
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 | |
rails new lessjs --skip-bundle | |
cd lessjs | |
echo '' >> Gemfile | |
echo 'gem "therubyracer"' >> Gemfile | |
echo 'gem "less-rails"' >> Gemfile | |
bundle install --path vendor/bundle | |
mv app/assets/stylesheets/application.css app/assets/stylesheets/application.css.less | |
rails g scaffold iloveless name:string | |
echo '' >> app/assets/stylesheets/application.css.less | |
echo '@BGCOLOR: #031035;' >> app/assets/stylesheets/application.css.less | |
echo '@FONTCOLOR: #fff;' >> app/assets/stylesheets/application.css.less | |
echo 'html {' >> app/assets/stylesheets/application.css.less | |
echo ' * {' >> app/assets/stylesheets/application.css.less | |
echo ' color: @FONTCOLOR;' >> app/assets/stylesheets/application.css.less | |
echo ' }' >> app/assets/stylesheets/application.css.less | |
echo ' body {' >> app/assets/stylesheets/application.css.less | |
echo ' background: @BGCOLOR;' >> app/assets/stylesheets/application.css.less | |
echo ' }' >> app/assets/stylesheets/application.css.less | |
echo '}' >> app/assets/stylesheets/application.css.less | |
rake db:migrate | |
rails s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment