11using System ;
22using System . IO ;
3+ using System . Linq ;
34using static Bullseye . Targets ;
45using static SimpleExec . Command ;
56
@@ -22,14 +23,20 @@ static void Main(string[] args)
2223 {
2324 return ;
2425 }
25- var di = new DirectoryInfo ( ArtifactsDir ) ;
26- foreach ( var file in di . GetFiles ( ) )
26+ var filesToDelete = Directory
27+ . GetFiles ( ArtifactsDir , "*.*" , SearchOption . AllDirectories )
28+ . Where ( f => ! f . EndsWith ( ".gitignore" ) ) ;
29+ foreach ( var file in filesToDelete )
2730 {
28- file . Delete ( ) ;
31+ Console . WriteLine ( $ "Deleting file { file } ") ;
32+ File . SetAttributes ( file , FileAttributes . Normal ) ;
33+ File . Delete ( file ) ;
2934 }
30- foreach ( var dir in di . GetDirectories ( ) )
35+ var directoriesToDelete = Directory . GetDirectories ( "artifacts" ) ;
36+ foreach ( var directory in directoriesToDelete )
3137 {
32- dir . Delete ( true ) ;
38+ Console . WriteLine ( $ "Deleting directory { directory } ") ;
39+ Directory . Delete ( directory , true ) ;
3340 }
3441 } ) ;
3542
@@ -39,13 +46,13 @@ static void Main(string[] args)
3946 RunTests ,
4047 DependsOn ( Build ) ,
4148 ForEach ( "LittleForker.Tests" ) ,
42- project => Run ( "dotnet" , $ "test src/{ project } /{ project } .csproj -c Release -r ../../ { ArtifactsDir } --no-build -l trx;LogFileName={ project } .xml --verbosity=normal") ) ;
49+ project => Run ( "dotnet" , $ "test src/{ project } /{ project } .csproj -c Release -r { ArtifactsDir } --no-build -l trx;LogFileName={ project } .xml --verbosity=normal") ) ;
4350
4451 Target (
4552 Pack ,
4653 DependsOn ( Build ) ,
4754 ForEach ( "LittleForker" ) ,
48- project => Run ( "dotnet" , $ "pack src/{ project } /{ project } .csproj -c Release -o ../../ { ArtifactsDir } --no-build") ) ;
55+ project => Run ( "dotnet" , $ "pack src/{ project } /{ project } .csproj -c Release -o { ArtifactsDir } --no-build") ) ;
4956
5057 Target ( Publish , DependsOn ( Pack ) , ( ) =>
5158 {
0 commit comments