-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset-targets.rb
executable file
·62 lines (53 loc) · 1.5 KB
/
reset-targets.rb
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env ruby
#
#
require "bundler"
Bundler.require(:default)
# require "google_drive"
require './lib/bug_crush'
# require './lib/put_in_spreadsheet'
# require './lib/make_worksheet'
# require './lib/make_copy_state'
usage_msg = "Usage: #{__FILE__} <notused.csv> v2 <notused2.csv>
The v2 sheet target is reset so it can be used for another iteration"
if ARGV.length != 3
puts usage_msg
Kernel.exit(1)
end
require './params'
config =
# if ARGV[1] == "v1"
# {
# google_sheet_id: "1DBpqlv36PwQu5-QlY24S2XDkEnkxWWxo46igMtBiwAo",
# scrub_event_id: "Q3 (0001)",
# previous_event_id: "Q2 (Final)",
# csvinput_filename: ARGV[0]
# }
# elsif ARGV[1] == "v2"
{
google_sheet_id: Params.google_sheet_id,
scrub_event_id: Params.scrub_event_id,
previous_event_id: Params.previous_event_id,
csvinput_filename: ARGV[0],
discussion_csvinput_filename: ARGV[2],
}
# else
# puts usage_msg
# Kernel.exit(1)
# end
o = BugCrush::Spreadsheet.new(**config)
success = o.revert
w = BugCrush::Worksheet.
new(spreadsheet: o, new_worksheet_label: config[:scrub_event_id])
success2 = w.revert
if success && success2
puts "Success, progress was hollowed out and reverted"
elsif !success
puts "Error during BugCrush::Spreadsheet.revert"
puts "hint: absolutely no idea what could have gone wrong here"
Kernel.exit(1)
elsif !success2
puts "Error during BugCrush::Worksheet.revert"
puts "hint: absolutely no idea what could have gone wrong here"
Kernel.exit(1)
end