diff options
| author | Daniel Bovensiepen <[email protected]> | 2013-06-15 03:53:50 +0800 |
|---|---|---|
| committer | Daniel Bovensiepen <[email protected]> | 2013-06-15 03:53:50 +0800 |
| commit | 373122a299ebec890cfaa95ee41fde221ac6a543 (patch) | |
| tree | 346e79bb8a30a4e0b4102babf7dd9407beb36979 /tasks/mruby_build_commands.rake | |
| parent | ad07d41bd1b42fe7d23e04361839f511c5f9cd7f (diff) | |
| parent | 961cd408a86580c4d428f56153da00fd46738e35 (diff) | |
| download | mruby-373122a299ebec890cfaa95ee41fde221ac6a543.tar.gz mruby-373122a299ebec890cfaa95ee41fde221ac6a543.zip | |
Merge upstream
Diffstat (limited to 'tasks/mruby_build_commands.rake')
| -rw-r--r-- | tasks/mruby_build_commands.rake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index 1d69fa54d..349b8717d 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -220,19 +220,28 @@ module MRuby class Command::Git < Command attr_accessor :flags - attr_accessor :clone_options + attr_accessor :clone_options, :pull_options def initialize(build) super @command = 'git' @flags = [] @clone_options = "clone %{flags} %{url} %{dir}" + @pull_options = "pull" end def run_clone(dir, url, _flags = []) _pp "GIT", url, dir.relative_path _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } end + + def run_pull(dir, url) + root = Dir.pwd + Dir.chdir dir + _pp "GIT PULL", url, dir.relative_path + _run pull_options + Dir.chdir root + end end class Command::Mrbc < Command @@ -250,9 +259,14 @@ module MRuby infiles.each do |f| _pp "MRBC", f.relative_path, nil, :indent => 2 end - IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}} #{infiles.join(' ')}", 'r+') do |io| + IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}} #{filename(infiles).join(' ')}", 'r+') do |io| out.puts io.read end + # if mrbc execution fail, drop the file + unless $?.exitstatus + File.delete(out.path) + exit -1 + end end end |
