Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ function isExcludedSourceFile(path: string): boolean {
return sourceExcludedExtensions.some((extension) => path.endsWith(extension))
}

// zip all dependency files and all source files excluding "target" (contains large JARs) plus ".git" and ".idea" (may appear in diff.patch)
// zip all dependency files and all source files
// excludes "target" (contains large JARs) plus ".git", ".idea", and ".github" (may appear in diff.patch)
export function getFilesRecursively(dir: string, isDependenciesFolder: boolean): string[] {
const entries = nodefs.readdirSync(dir, { withFileTypes: true })
const files = entries.flatMap((entry) => {
Expand All @@ -284,7 +285,12 @@ export function getFilesRecursively(dir: string, isDependenciesFolder: boolean):
if (isDependenciesFolder) {
// include all dependency files
return getFilesRecursively(res, isDependenciesFolder)
} else if (entry.name !== 'target' && entry.name !== '.git' && entry.name !== '.idea') {
} else if (
entry.name !== 'target' &&
entry.name !== '.git' &&
entry.name !== '.idea' &&
entry.name !== '.github'
) {
// exclude the above directories when zipping source code
return getFilesRecursively(res, isDependenciesFolder)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ dependencyManagement:
await fs.mkdir(gitFolder)
await fs.writeFile(path.join(gitFolder, 'config'), 'sample content for the test file')

const githubFolder = path.join(tempDir, '.github')
await fs.mkdir(githubFolder)
await fs.writeFile(path.join(githubFolder, 'config'), 'more sample content for the test file')

const zippedFiles = getFilesRecursively(tempDir, false)
assert.strictEqual(zippedFiles.length, 1)
})
Expand Down
Loading