MCPcopy Create free account
hub / github.com/observablehq/framework / findMostRecentSourceMtimeMs

Method findMostRecentSourceMtimeMs

src/deploy.ts:530–551  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528 }
529
530 private async findMostRecentSourceMtimeMs(): Promise<number> {
531 let mostRecentMtimeMs = -Infinity;
532 for await (const file of this.effects.visitFiles(this.deployOptions.config.root)) {
533 const joinedPath = join(this.deployOptions.config.root, file);
534 const stat = await this.effects.stat(joinedPath);
535 if (stat.mtimeMs > mostRecentMtimeMs) {
536 mostRecentMtimeMs = stat.mtimeMs;
537 }
538 }
539 const cachePath = join(this.deployOptions.config.root, ".observablehq/cache");
540 try {
541 const cacheStat = await this.effects.stat(cachePath);
542 if (cacheStat.mtimeMs > mostRecentMtimeMs) {
543 mostRecentMtimeMs = cacheStat.mtimeMs;
544 }
545 } catch (error) {
546 if (!isEnoent(error)) {
547 throw error;
548 }
549 }
550 return mostRecentMtimeMs;
551 }
552
553 private async findLeastRecentBuildMtimeMs(): Promise<number> {
554 let leastRecentMtimeMs = Infinity;

Callers 1

getBuildFilePathsMethod · 0.95

Calls 3

isEnoentFunction · 0.85
visitFilesMethod · 0.80
statMethod · 0.80

Tested by

no test coverage detected