mirror of
https://github.com/actions/upload-artifact.git
synced 2025-12-17 21:57:30 +00:00
Exclude hidden files by default
This commit is contained in:
parent
834a144ee9
commit
cb6558bb10
18 changed files with 169 additions and 36 deletions
|
|
@ -11,11 +11,12 @@ export interface SearchResult {
|
|||
rootDirectory: string
|
||||
}
|
||||
|
||||
function getDefaultGlobOptions(): glob.GlobOptions {
|
||||
function getDefaultGlobOptions(_includeHiddenFiles: boolean): glob.GlobOptions {
|
||||
return {
|
||||
followSymbolicLinks: true,
|
||||
implicitDescendants: true,
|
||||
omitBrokenSymbolicLinks: true
|
||||
omitBrokenSymbolicLinks: true,
|
||||
// excludeHiddenFiles: !includeHiddenFiles,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,12 +81,12 @@ function getMultiPathLCA(searchPaths: string[]): string {
|
|||
|
||||
export async function findFilesToUpload(
|
||||
searchPath: string,
|
||||
globOptions?: glob.GlobOptions
|
||||
includeHiddenFiles?: boolean,
|
||||
): Promise<SearchResult> {
|
||||
const searchResults: string[] = []
|
||||
const globber = await glob.create(
|
||||
searchPath,
|
||||
globOptions || getDefaultGlobOptions()
|
||||
getDefaultGlobOptions(includeHiddenFiles || false)
|
||||
)
|
||||
const rawSearchResults: string[] = await globber.glob()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue