Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ All changes included in 1.10:

- ([#6651](https://github.com/quarto-dev/quarto-cli/issues/6651)): Fix dart-sass compilation failing in enterprise environments where `.bat` files are blocked by group policy.
- ([#14255](https://github.com/quarto-dev/quarto-cli/issues/14255)): Fix shortcodes inside inline and display math expressions not being resolved.

- ([#14342](https://github.com/quarto-dev/quarto-cli/issues/14342)): Work around TOCTOU race in Deno's `expandGlobSync` that can cause unexpected exceptions to be raised while traversing directories during project initialization.
24 changes: 17 additions & 7 deletions src/core/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,23 @@ export function resolvePathGlobs(
const expandGlobs = (targetGlobs: string[]) => {
const expanded: string[] = [];
for (const glob of targetGlobs) {
for (
const file of expandGlobSync(
glob,
{ root, exclude, includeDirs: true, extended: true, globstar: true },
)
) {
expanded.push(file.path);
try {
for (
const file of expandGlobSync(
glob,
{ root, exclude, includeDirs: true, extended: true, globstar: true },
)
) {
expanded.push(file.path);
}
} catch (e) {
// expandGlobSync can throw NotFound if a file is deleted between
// directory listing and stat (TOCTOU race). This is expected during
// preview when the IDE or other processes modify the project
// directory concurrently.
if (!(e instanceof Deno.errors.NotFound)) {
throw e;
}
}
}
return ld.uniq(expanded);
Expand Down
Loading