Skip to content

Commit

Permalink
Debugging windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jul 8, 2024
1 parent 616a3cf commit 391e7e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@
"publishConfig": {
"provenance": true
}
}
}
10 changes: 7 additions & 3 deletions packages/astro/src/content/loaders/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export function glob(globOptions: GlobOptions): Loader {
)
);

if (!watcher) {
return;
}

const matcher: RegExp = micromatch.makeRe(globOptions.pattern);

const matchesGlob = (entry: string) => !entry.startsWith('../') && matcher.test(entry);
Expand All @@ -152,11 +156,11 @@ export function glob(globOptions: GlobOptions): Loader {
await syncData(entry, baseUrl, options, entryType);
logger.info(`Reloaded data from ${green(entry)}`);
}
watcher?.on('change', onChange);
watcher.on('change', onChange);

watcher?.on('add', onChange);
watcher.on('add', onChange);

watcher?.on('unlink', async (deletedPath) => {
watcher.on('unlink', async (deletedPath) => {
const entry = relative(basePath, deletedPath);
if (!matchesGlob(entry)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ const cats = defineCollection({
}),
});


// Absolute paths should also work
const absoluteRoot = fileURLToPath(new URL('../../content-outside-src', import.meta.url))
const absoluteRoot = new URL('../../content-outside-src', import.meta.url).href;

const spacecraft = defineCollection({
type: 'experimental_data',
Expand Down
2 changes: 1 addition & 1 deletion scripts/cmd/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import arg from 'arg';
import glob from 'tiny-glob';

const isCI = !!process.env.CI;
const defaultTimeout = isCI ? 1400000 : 600000;
const defaultTimeout = 600000 //isCI ? 600000 : 600000;

export default async function test() {
const args = arg({
Expand Down

0 comments on commit 391e7e6

Please sign in to comment.