Skip to content
Browse files

Added checks before trying to mkdir a directory

  • Loading branch information...
1 parent a59e114 commit 65aaa5a3a8d87c5ebae0ee62498b94cc10766668 Lars Wilhelmsen committed May 3, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 rakefile.rb
View
16 rakefile.rb
@@ -61,8 +61,12 @@
desc "Gathers output files and copies them to the output folder"
task :publish => [:compile] do
- Dir.mkdir(OUTPUT)
- Dir.mkdir("#{OUTPUT}/binaries")
+ if not File.directory? OUTPUT
+ Dir.mkdir(OUTPUT)
+ end
+ if not File.directory? "#{OUTPUT}/binaries"
+ Dir.mkdir("#{OUTPUT}/binaries")
+ end
FileUtils.cp_r FileList["src/**/#{CONFIGURATION}/*.dll", "src/**/#{CONFIGURATION}/*.pdb", "src/**/*.ps1"].exclude(/obj\//).exclude(/.Tests/), "#{OUTPUT}/binaries"
end
@@ -93,7 +97,9 @@
desc "Zips up the built binaries for easy distribution"
zip :package => [:publish] do |zip|
- Dir.mkdir("#{OUTPUT}/packages")
+ if not File.directory? "#{OUTPUT}/packages"
+ Dir.mkdir("#{OUTPUT}/packages")
+ end
zip.directories_to_zip "#{OUTPUT}/binaries"
zip.output_file = "Nancy-Latest.zip"
@@ -102,7 +108,9 @@
desc "Generates NuGet packages for each project that contains a nuspec"
task :nuget_package => [:publish] do
- Dir.mkdir("#{OUTPUT}/nuget")
+ if not File.directory? "#{OUTPUT}/nuget"
+ Dir.mkdir("#{OUTPUT}/nuget")
+ end
nuspecs = FileList["src/**/*.nuspec"]
root = File.dirname(__FILE__)

0 comments on commit 65aaa5a

Please sign in to comment.
Something went wrong with that request. Please try again.