pyar6329
10/12/2014 - 5:48 PM

middleman Template slim

middleman Template slim

#!/bin/sh
if [ ! "$#" = "1" ]; then
  echo "$RED""please input app_name!""$COLOR_OFF"
else
  thishere=`pwd`
  tmpdirectory="tmpfileshoogehogehogehoge"
  mkdir "$tmpdirectory"
  cd "$tmpdirectory"
  bundle init
  echo "gem 'middleman'" >> Gemfile
  echo "gem 'middleman-slim'" >> Gemfile
  bundle install --path .bundle
  bundle exec middleman init $1 --rack --template slim
  rm -rf .bundle
  rm -rf Gemfile
  rm -rf Gemfile.lock
  cd "$1"
  bundle install --path .bundle
  cd ..
  mv "$1" "$thishere"
  cd ../
  echo `pwd`
  rm -rf "$tmpdirectory"
fi