Skip to content

Commit

Permalink
fix: Installs underneath a path containing leading underscores (#7476)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirasso committed Jun 26, 2023
1 parent c1564d3 commit 478cd9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-papayas-invite.md
@@ -0,0 +1,5 @@
---
'astro': patch
---

Allow astro to be installed underneath a folder with leading slashes
Expand Up @@ -21,6 +21,7 @@ import {
type ContentLookupMap,
type ContentPaths,
} from './utils.js';
import { appendForwardSlash } from '../core/path.js';

interface AstroContentVirtualModPluginParams {
settings: AstroSettings;
Expand Down Expand Up @@ -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}`];
}

0 comments on commit 478cd9d

Please sign in to comment.