Skip to content
Permalink
Browse files
(fix) ingnore hidden files in staging
  • Loading branch information
chtompki committed Jun 14, 2018
1 parent 041d028 commit a5bfc15a43a708a6eadac3b65e1745a1b122bc8e
Showing 1 changed file with 5 additions and 5 deletions.
@@ -196,7 +196,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,
provider, repository);
List<File> filesToAdd = new ArrayList<>();
listFilesAndDirectories(distCheckoutDirectory, filesToAdd);
listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);
if (!dryRun) {
ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);
AddScmResult addResult = provider.add(
@@ -235,15 +235,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
* @param directory {@link File} containing directory to list
* @param files a {@link List} of {@link File} to which to append the files.
*/
private void listFilesAndDirectories(File directory, List<File> files) {
private void listNotHiddenFilesAndDirectories(File directory, List<File> files) {
// Get all the files and directories from a directory.
File[] fList = directory.listFiles();
for (File file : fList) {
if (file.isFile() && !file.getAbsolutePath().contains(".svn")) {
if (file.isFile() && !file.isHidden()) {
files.add(file);
} else if (file.isDirectory() && !file.getAbsolutePath().contains(".svn")) {
} else if (file.isDirectory() && !file.isHidden()) {
files.add(file);
listFilesAndDirectories(file, files);
listNotHiddenFilesAndDirectories(file, files);
}
}
}

0 comments on commit a5bfc15

Please sign in to comment.