Created
August 29, 2016 17:00
-
-
Save felinebabies/51e9e668c30cb2fd2647342d6c741810 to your computer and use it in GitHub Desktop.
middlemanのビルド結果をgithubpages用ブランチにミラーリングしてtortoisegitのコミット画面を開く
This file contains hidden or 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
| # coding: utf-8 | |
| require 'bundler' | |
| Bundler.require | |
| Dotenv.load | |
| currentdir = File.dirname(__FILE__) | |
| builddir = File.join(currentdir, "build") | |
| deploydir = ENV["DEPLOYDIR"] | |
| if(!deploydir) then | |
| puts "DEPLOYDIRが未指定です" | |
| exit | |
| end | |
| tortoisegitexe = ENV["TORTOISEGITPATH"] | |
| if(!tortoisegitexe) then | |
| puts "TORTOISEGITPATHが未指定です" | |
| exit | |
| end | |
| # 現在のmiddlemanプロジェクトをビルドする | |
| print `bundle exec middleman build` | |
| # 指定ディレクトリにビルドファイルをミラーリングする | |
| rbsync = RbSync.new | |
| rbsync.sync(builddir, deploydir) | |
| # tortoisegitのコミット画面を開く | |
| `\"#{tortoisegitexe}\" /command:commit /path:\"#{deploydir}\"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment