Permalink
Browse files

Replaced NuGetPackageBuilder.cmd with a powershell equivalent (it's a…

… powershell lib after all)
  • Loading branch information...
1 parent a1a1a5e commit 0df488933365a641f4af968c80af990beecd9a54 @damianh damianh committed with Jun 10, 2012
Showing with 14 additions and 27 deletions.
  1. +0 −27 NuGetPackageBuilder.cmd
  2. +14 −0 NuGetPackageBuilder.ps1
View
@@ -1,27 +0,0 @@
-@echo on
-
-:: Assumes robocopy on the path
-
-SET DIR=%~dp0%
-SET DESTDIR=%DIR%bin
-
-IF EXIST %DESTDIR% goto deletebin
-
-goto prepare
-
-:deletebin
-rmdir /s /q %DESTDIR%
-if %ERRORLEVEL% NEQ 0 goto errors
-
-:prepare
-robocopy %DIR% %DESTDIR%\tools /E /B /NP /R:0 /W:0 /NJH /NJS /NS /NFL /NDL /XF ".git*" "Nuget*" "*.nupkg" /XD "%DIR%nuget" "%DIR%.git" "%DIR%bin"
-robocopy %DIR%nuget %DESTDIR% /E /B /NP /R:0 /W:0 /NJH /NJS /NS /NFL /NDL
-
-:build
-nuget pack %DESTDIR%\psake.nuspec
-if %ERRORLEVEL% NEQ 0 goto errors
-
-goto :eof
-
-:errors
-EXIT /B %ERRORLEVEL%
View
@@ -0,0 +1,14 @@
+# Assumes robocopy on the path
+
+$scriptpath = $MyInvocation.MyCommand.Path
+$dir = Split-Path $scriptpath
+$destDir = "$dir\bin"
+if(Test-Path $destDir -PathType container){
+ Remove-Item $destDir -Recurse -Force
+}
+
+robocopy $dir "$destDir\tools" /E /B /NP /R:0 /W:0 /NJH /NJS /NS /NFL /NDL /XF ".git*" "Nuget*" "*.nupkg" /XD "%DIR%nuget" "$dir.git" "$destDir"
+robocopy $dir "$destDir\tools" /E /B /NP /R:0 /W:0 /NJH /NJS /NS /NFL /NDL /XF ".git*" "Nuget*" "*.nupkg" /XD "%DIR%nuget" "$dir.git" "$destDir"
+robocopy "$dir\nuget" $destDir /E /B /NP /R:0 /W:0 /NJH /NJS /NS /NFL /NDL
+
+.\nuget pack "$destDir\psake.nuspec"

0 comments on commit 0df4889

Please sign in to comment.