Skip to content

Commit db0f9a5

Browse files
committed
eliminate file crawling delay at beginning of project render
1 parent 441cd9b commit db0f9a5

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/core/path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function resolvePathGlobs(
102102
if (!glob.startsWith("/")) {
103103
return "**/" + glob;
104104
} else {
105-
return glob.slice(1);
105+
return glob;
106106
}
107107
};
108108

src/project/project-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function projectInputFiles(dir: string, metadata?: ProjectConfig) {
295295
// virtualenvs include symblinks to R or Python libraries that are in turn
296296
// circular. much safer to not follow symlinks!
297297
followSymlinks: false,
298-
skip: [kSkipHidden],
298+
skip: projectIgnores.concat([kSkipHidden]),
299299
},
300300
)
301301
) {

src/project/project-gitignore.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ import { ProjectContext } from "./project-context.ts";
1616
import { kQuartoScratch } from "./project-scratch.ts";
1717
import { lines } from "../core/text.ts";
1818

19-
export const kGitignoreEntries = [
20-
`${kQuartoScratch}/`,
19+
export const kQuartoIgnore = [`/${kQuartoScratch}/`];
20+
21+
export const kGitignoreEntries = kQuartoIgnore.concat([
2122
"*_cache/",
22-
];
23+
]);
2324

2425
export async function ensureGitignore(project: ProjectContext) {
2526
// if .gitignore exists, then ensure it has the requisite entries

src/project/project-resources.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
kProjectResources,
1919
ProjectConfig,
2020
} from "./project-context.ts";
21-
import { kGitignoreEntries } from "./project-gitignore.ts";
21+
import { kQuartoIgnore } from "./project-gitignore.ts";
2222

2323
export function projectResourceFiles(
2424
dir: string,
@@ -29,8 +29,8 @@ export function projectResourceFiles(
2929
const outputDir = config.project[kProjectOutputDir];
3030
if (outputDir) {
3131
resourceGlobs = (resourceGlobs || [])
32-
// ignore anything specified in our standard .gitignore
33-
.concat(kGitignoreEntries.map((entry) => `!${entry}`))
32+
// ignore standard quarto ignores (e.g. /.quarto/)
33+
.concat(kQuartoIgnore.map((entry) => `!${entry}`))
3434
// some files typically included in the root of websites
3535
.concat(["/robots.txt", "/.nojekyll", "/_redirects"]);
3636

0 commit comments

Comments
 (0)