-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
43 lines (25 loc) · 995 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
desc <<-DESC
Copy-paste the contents of this directory to the public
etdataset repository.
DESC
task :publish do
source = '.'
destination = '../etdataset-public'
exclude = %w[.git corrected_energy_balance_step_1.csv corrected_energy_balance_step_2.csv energy_balance.csv *autoproducer_table*.* platts.csv odyssee.csv *.encrypted.csv]
#-------- REMOVE ENTIRE DIRETORY -------------------------------------------
cmd = "rm -rf #{ destination }/*"
puts "Executing #{ cmd }"
%x[ #{ cmd } ]
#-------- COPY EVERYTHING PRUNED -------------------------------------------
cmd = ['rsync -rv']
cmd += exclude.map { |e| "--exclude='#{ e }'" }
cmd.push source
cmd.push destination
%x[ #{ cmd.join(" ") } ]
puts "Executing #{ cmd.join(" ") }"
#-------- COPY COMPLETE EXAMPLE DATASET -----------------------------
cmd2 = "rsync -rv #{ source }/data/example #{ destination }/data"
puts "Executing #{ cmd2 }"
%x[ #{ cmd2 } ]
puts "Done!"
end