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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
# File 'lib/fastlane/plugin/match_import/commands_generator.rb', line 16
def run
program :name, 'match_import'
program :version, Fastlane::MatchImport::VERSION
program :description, Fastlane::MatchImport::DESCRIPTION
program :help, 'Author', 'Sergii Batsevych <[email protected]>'
program :help, 'Website', 'https://fastlane.tools'
program :help, 'GitHub', 'https://github.com/serbats/fastlane-plugin-match_import'
program :help_formatter, :compact
global_option('--verbose') { FastlaneCore::Globals.verbose = true }
command :import do |c|
c.syntax = 'match_import import'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::CustomFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import import --file_name='*.txt' --source_path='testDir' --destination_path='repoDir'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::CustomFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::Runner.new.run(params)
end
end
command :export do |c|
c.syntax = 'match_import export'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::CustomFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import export --file_name='*.txt' --source_path='repoDir' --destination_path='testDir'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::CustomFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::Runner.new.run_export(params)
end
end
command :remove do |c|
c.syntax = 'match_import remove'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::CustomFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import remove --file_name='*.txt' --source_path='repoDir'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::CustomFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::Runner.new.run_remove(params)
end
end
command :import_apns do |c|
c.syntax = 'match_import import_apns'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::APNSFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import import_apns --type='development' --cert_file_name='PushDev.cer' --p12_file_name='PushDev.p12'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::APNSFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::RunnerAPNS.new.run(params)
end
end
command :export_apns do |c|
c.syntax = 'match_import export_apns'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::APNSExportFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import export_apns --type='development' --keychain_name='FastlaneKeychain' --keychain_password='password' --destination_path='testDir'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::APNSExportFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::RunnerAPNS.new.run_export(params)
end
end
command :remove_invalid_apns do |c|
c.syntax = 'match_import remove_invalid_apns'
c.description = Fastlane::MatchImport::DESCRIPTION
FastlaneCore::CommanderGenerator.new.generate(Fastlane::MatchImport::APNSRemoveInvalidFileOptions.available_options, command: c)
c.action do |args, options|
if args.count > 0
FastlaneCore::UI.user_error!("Please run `match_import remove_invalid_apns --type='development'`")
end
params = FastlaneCore::Configuration.create(Fastlane::MatchImport::APNSRemoveInvalidFileOptions.available_options, options.__hash__)
params.load_configuration_file("Matchfile")
Match::Encryption.register_backend(type: "git", encryption_class: MatchImport::Encryption::OpenSSL)
Match::Encryption.register_backend(type: "s3", encryption_class: MatchImport::Encryption::OpenSSL)
Fastlane::MatchImport::RunnerAPNS.new.run_remove_invalid(params)
end
end
default_command(:import)
run!
end
|