35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/karo/assets.rb', line 35
def push
configuration = Config.load_configuration(options)
path_local = File.expand_path("public/system/dragonfly/development")
unless File.exists?(path_local)
raise Thor::Error, "Please make sure that this local path exists? '#{path_local}'"
end
host = "deploy@#{configuration["host"]}"
path_server = File.join(configuration["path"], "shared/system/dragonfly/#{options[:environment]}")
cmd_1 = "ssh #{host} 'mkdir -p #{path_server}'"
cmd_2 = "rsync -az --progress #{path_local}/ #{host}:#{path_server}/"
if options[:verbose]
say cmd_1, :green
say cmd_2, :green
end
if yes?("Are you sure?", :yellow)
system "#{cmd_1}"
system "#{cmd_2}"
say "Assets sync complete", :green
else
say "Assets sync cancelled", :yellow
end
end
|