Class: Commit

Inherits:
Array show all
Defined in:
lib/dev_commands.rb

Overview

require_relative(‘internet.rb’)

Instance Method Summary collapse

Methods inherited from Array

#add, #execute, #to_html

Instance Method Details

#updateObject



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/dev_commands.rb', line 598

def update
	if(File.exists?('.git') && `git config --list`.include?('user.name='))
		if(!`git status`.include?('nothing to commit') &&
		   !`git status`.include?('untracked files present'))
		  if(File.exists?('commit.message') && File.read('commit.message').gsub(/\s+/,"").length >0)
		  	add "git commit -a -v -m \"#{File.read('commit.message')}\""
		  else
		    add "git commit -m'all'"
		  end
		  add "<%FileUtils.rm('commit.message')%>" if File.exists?('commit.message')
	    end 		
	end
	if(File.exists?('.svn') && Internet.available?)
		add 'svn commit -m"commit all"'
	end
end