19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/rusic/cli.rb', line 19
def deploy(env = nil)
path = Pathname.new(Dir.pwd)
files = []
files << Dir.glob(path.join('{layouts,ideas,pages,participant,snippets,mailers}', '*.liquid'))
files << Dir.glob(path.join('assets', '*.*'))
files << Dir.glob(path.join('attributes.{yml,yaml}'))
files.flatten!
if options['watch']
FileWatcher.new(%w[layouts/ ideas/ pages/ assets/ participant/ attributes.yml snippets/ mailers/]).watch(0.5) do |file, event|
unless event == :delete
deployer = Rusic::Deployer.new(file)
deployer.upload_files(deploy_options_for(env))
end
end
else
deployer = Rusic::Deployer.new(files)
deployer.upload_files(deploy_options_for(env))
end
end
|