Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Sep 12, 2024
1 parent 5888da4 commit df63790
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/lib/glob-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Path from 'node:path'
import { CodeError } from '@libp2p/interface'
import glob from 'it-glob'
import type { MtimeLike } from 'ipfs-unixfs'
import type { Options as GlobOptions } from 'it-glob'

export interface GlobSourceOptions {
/**
Expand Down Expand Up @@ -58,15 +59,19 @@ export async function * globSource (cwd: string, pattern: string, options?: Glob
cwd = Path.resolve(process.cwd(), cwd)
}

const globOptions = Object.assign({}, {
nodir: false,
realpath: false,
const globOptions: GlobOptions = Object.assign({}, {
onlyFiles: false,
absolute: true,
dot: Boolean(options.hidden),
follow: options.followSymlinks ?? true
})
followSymbolicLinks: options.followSymlinks ?? true
} satisfies GlobOptions)

for await (const p of glob(cwd, pattern, globOptions)) {
// Workaround for https://github.com/micromatch/micromatch/issues/251
if (Path.basename(p).startsWith('.') && options.hidden !== true) {
continue
}

const stat = await fsp.stat(p)

let mode = options.mode
Expand Down

0 comments on commit df63790

Please sign in to comment.