mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix: Installs underneath a path containing leading underscores (#7476)
This commit is contained in:
parent
c1564d3c02
commit
478cd9d8fa
2 changed files with 8 additions and 1 deletions
5
.changeset/flat-papayas-invite.md
Normal file
5
.changeset/flat-papayas-invite.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Allow astro to be installed underneath a folder with leading slashes
|
|
@ -21,6 +21,7 @@ import {
|
|||
type ContentLookupMap,
|
||||
type ContentPaths,
|
||||
} from './utils.js';
|
||||
import { appendForwardSlash } from '../core/path.js';
|
||||
|
||||
interface AstroContentVirtualModPluginParams {
|
||||
settings: AstroSettings;
|
||||
|
@ -209,5 +210,6 @@ const UnexpectedLookupMapError = new AstroError({
|
|||
|
||||
function globWithUnderscoresIgnored(relContentDir: string, exts: string[]): string[] {
|
||||
const extGlob = getExtGlob(exts);
|
||||
return [`${relContentDir}/**/*${extGlob}`, `!**/_*/**${extGlob}`, `!**/_*${extGlob}`];
|
||||
const contentDir = appendForwardSlash(relContentDir);
|
||||
return [`${contentDir}**/*${extGlob}`, `!${contentDir}_*/**${extGlob}`, `!${contentDir}_*${extGlob}`];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue