six-updater 0.13.4 → 0.13.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six/updater.rb +12 -8
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/six/updater.rb
CHANGED
@@ -44,7 +44,7 @@ end
|
|
44
44
|
module Six
|
45
45
|
# TODO: Evaluate if this module should be a class instead?
|
46
46
|
module Updater
|
47
|
-
VERSION = '0.13.
|
47
|
+
VERSION = '0.13.5'
|
48
48
|
COMPONENT = 'six-updater'
|
49
49
|
|
50
50
|
# Configuration
|
@@ -83,7 +83,7 @@ module Six
|
|
83
83
|
|
84
84
|
DATA_PATH = if ENV['APPDATA']
|
85
85
|
if ENV['APPDATA'].size > 0
|
86
|
-
if File.
|
86
|
+
if File.directory?(ENV['APPDATA'])
|
87
87
|
File.join(ENV['APPDATA'], 'Six-Updater')
|
88
88
|
else
|
89
89
|
BASE_PATH
|
@@ -97,12 +97,16 @@ module Six
|
|
97
97
|
|
98
98
|
|
99
99
|
lf = File.join(DATA_PATH, "logs")
|
100
|
-
FileUtils.mkdir_p(lf) unless File.
|
100
|
+
FileUtils.mkdir_p(lf) unless File.directory?(lf)
|
101
101
|
|
102
102
|
cf = File.join(DATA_PATH, "#{COMPONENT}.yml")
|
103
103
|
unless File.exists?(cf)
|
104
104
|
cfo = File.join(BASE_PATH, "#{COMPONENT}.yml")
|
105
|
-
FileUtils.
|
105
|
+
FileUtils.cp(cfo, cf) if File.exists?(cfo)
|
106
|
+
begin
|
107
|
+
FileUtils.rm_f(cfo) if File.exists?(cfo)
|
108
|
+
rescue
|
109
|
+
end
|
106
110
|
end
|
107
111
|
|
108
112
|
LOG_LIMIT = 9999
|
@@ -180,7 +184,7 @@ module Six
|
|
180
184
|
if ARGV[0]
|
181
185
|
# FIXME: This is not a very good catch..
|
182
186
|
if ARGV[0][/.*\..*/]
|
183
|
-
if
|
187
|
+
if File.exists?(ARGV[0])
|
184
188
|
config = ARGV[0]
|
185
189
|
else
|
186
190
|
log.warn "#{ARGV[0]} not found, trying #{config}"
|
@@ -188,7 +192,7 @@ module Six
|
|
188
192
|
end
|
189
193
|
end
|
190
194
|
|
191
|
-
unless
|
195
|
+
unless File.exists?(config)
|
192
196
|
log.error "ERROR: #{config} config missing!"
|
193
197
|
wait
|
194
198
|
exit
|
@@ -230,7 +234,7 @@ module Six
|
|
230
234
|
# Verify installation folder
|
231
235
|
if @config[:app_path]
|
232
236
|
log.info "ArmA Path: #{@config[:app_path]}"
|
233
|
-
if
|
237
|
+
if File.exists?(@config[:app_path])
|
234
238
|
@config[:app_path].gsub!('\\', '/')
|
235
239
|
else
|
236
240
|
log.error "No valid ArmA installation folder found, please abort!"
|
@@ -245,7 +249,7 @@ module Six
|
|
245
249
|
|
246
250
|
if @config[:app_modpath]
|
247
251
|
log.info "Installation Path: #{@config[:app_modpath]}"
|
248
|
-
if
|
252
|
+
if File.exists?(@config[:app_modpath])
|
249
253
|
@config[:app_modpath].gsub!('\\', '/')
|
250
254
|
else
|
251
255
|
log.error "No valid Mod installation folder found, please abort!"
|