lib/remote_file_target.rb in sprout-0.5.15 vs lib/remote_file_target.rb in sprout-0.5.19
- old
+ new
@@ -18,12 +18,16 @@
def resolve
# already run once, don't run again in this session
if(!file_name.nil?)
return
end
- @file_name = url.split('/').pop
- @downloaded_path = File.join(Sprout.cache, type, install_path, file_name)
+ if(url.nil? || url == '')
+ @file_name = ''
+ else
+ @file_name = url.split('/').pop
+ @downloaded_path = File.join(Sprout.cache, type, install_path, file_name)
+ end
if(archive_type == 'txt' || archive_type == 'exe')
@install_path = File.join(Sprout.cache, type, install_path)
else
@install_path = File.join(Sprout.cache, type, install_path, archive_type)
end
@@ -41,9 +45,12 @@
end
if(Sprout.update || !File.exists?(install_path))
# unpack into install path
loader.unpack_downloaded_file(downloaded_path, install_path)
+ if(post_install)
+ eval(post_install)
+ end
end
end
end
end