MCPcopy
hub / github.com/ampproject/amphtml / startAtRepoRoot

Function startAtRepoRoot

build-system/task-runner/amp-task-runner.js:56–62  ·  view source on GitHub ↗

* Switches the current directory to the repo root if needed. This is done so * that hard-coded paths within tasks can work predictably.

()

Source from the content-addressed store, hash-verified

54 * that hard-coded paths within tasks can work predictably.
55 */
56function startAtRepoRoot() {
57 const repoRoot = path.resolve(__dirname, '..', '..');
58 if (repoRoot != process.cwd()) {
59 process.chdir(repoRoot);
60 log('Working directory changed to', magenta(path.basename(repoRoot)));
61 }
62}
63
64/**
65 * 1. Updates root-level packages during local development. (Skipped during CI

Callers 1

createTaskFunction · 0.85

Calls 2

resolveMethod · 0.80
logFunction · 0.50

Tested by

no test coverage detected