Skip to content

Commit 38d31e2

Browse files
Add more tests for excluding files on a Composer-based project
1 parent 6c45513 commit 38d31e2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
continue;
7676
}
7777
if ( is_dir( $path . '/' . $file ) ) {
78-
$file .= '/*';
78+
$file = rtrim( $file, '/' ) . '/*';
7979
}
8080
$ignored_files[] = $archive_base . '/' . $file;
8181
}

features/dist-archive.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Feature: Generate a distribution archive of a project
4444
"""
4545
.gitignore
4646
.distignore
47+
features/
48+
"""
49+
And a foo/features/sample.feature file:
50+
"""
51+
Testing
4752
"""
4853
And a foo/composer.json file:
4954
"""
@@ -61,3 +66,12 @@ Feature: Generate a distribution archive of a project
6166
Success: Created foo.0.2.0-alpha.zip
6267
"""
6368
And the foo.0.2.0-alpha.zip file should exist
69+
70+
When I run `rm -rf foo`
71+
Then the foo directory should not exist
72+
73+
When I run `unzip foo.0.2.0-alpha.zip`
74+
Then the foo directory should exist
75+
And the foo/composer.json file should exist
76+
And the foo/.distignore file should not exist
77+
And the foo/features/sample.feature file should not exist

0 commit comments

Comments
 (0)