fix my rake file
This commit is contained in:
@@ -1,25 +1,28 @@
|
|||||||
|
require 'openssl'
|
||||||
|
|
||||||
namespace :tools do
|
namespace :tools do
|
||||||
|
|
||||||
# If we don't have a copy of nuget, download it
|
# If we don't have a copy of nuget, download it
|
||||||
task :nuget_bootstrap do
|
# If we don't have a copy of nuget, download it
|
||||||
puts 'Ensuring NuGet exists in tools/NuGet'
|
task :nuget_bootstrap do
|
||||||
|
puts 'Ensuring NuGet exists in tools/NuGet'
|
||||||
|
|
||||||
if !FileTest.exist?("#{NUGET}/nuget.exe")
|
if !FileTest.exist?("#{NUGET}/nuget.exe")
|
||||||
puts 'Downloading nuget from nuget.org'
|
puts 'Downloading nuget from nuget.org'
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FileUtils.mkdir_p("#{NUGET}")
|
FileUtils.mkdir_p("#{NUGET}")
|
||||||
File.open("#{NUGET}/nuget.exe", "wb") do |file|
|
File.open("#{NUGET}/nuget.exe", "wb") do |file|
|
||||||
file.write open('https://nuget.org/nuget.exe').read
|
file.write open('http://nuget.org/nuget.exe', {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
FileUtils.rm_rf("#{NUGET}/nuget.exe")
|
||||||
|
File.open("#{NUGET}/nuget.exe", "wb") do |file|
|
||||||
|
file.write open('https://nuget.org/nuget.exe', {ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
|
||||||
|
end
|
||||||
end
|
end
|
||||||
rescue
|
|
||||||
FileUtils.rm_rf("#{NUGET}/nuget.exe")
|
|
||||||
File.open("#{NUGET}/nuget.exe", "wb") do |file|
|
|
||||||
file.write open('http://nuget.org/nuget.exe').read
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Fetch nuget dependencies for all packages
|
# Fetch nuget dependencies for all packages
|
||||||
task :nuget_fetch => :nuget_bootstrap do
|
task :nuget_fetch => :nuget_bootstrap do
|
||||||
|
|||||||
Reference in New Issue
Block a user