bin/gritano in gritano-0.1.2 vs bin/gritano in gritano-0.1.3
- old
+ new
@@ -44,10 +44,17 @@
puts "Error: git must be installed on the local system"
exit
end
end
+def check_gritano
+ unless File.exist?(File.join(Etc.getpwuid.dir, '.gritano'))
+ puts "Error: First run 'gritano install'"
+ exit
+ end
+end
+
check_git
if ARGV.length == 1
if ARGV[0] =='install'
install
elsif ARGV[0] =='version'
@@ -56,18 +63,20 @@
help
end
elsif ARGV.length == 2 or ARGV.length == 0
help
else
+ check_gritano
ActiveRecord::Base.establish_connection(YAML::load(File.open(File.join(Etc.getpwuid.dir, '.gritano', 'database.yml'))))
console = Gritano::Console.new
console.repo_path = Etc.getpwuid.dir
console.ssh_path = File.join(Etc.getpwuid.dir, '.ssh')
begin
- if console.execute(ARGV)
- puts "command executed successfully"
+ cmd_return = console.execute(ARGV)
+ if cmd_return[0]
+ puts "success: #{cmd_return[1]}"
else
- puts "an error occurred"
+ puts "error: #{cmd_return[1]}"
end
rescue NoMethodError
puts help
end
end