MCPcopy Create free account
hub / github.com/ampproject/amphtml / writeTarget_

Function writeTarget_

build-system/tasks/prepend-global/index.js:79–86  ·  view source on GitHub ↗

* @param {string} filename Destination filename * @param {string} fileString String to write * @param {boolean=} opt_dryrun If true, print the contents without writing them * @return {!Promise }

(filename, fileString, opt_dryrun)

Source from the content-addressed store, hash-verified

77 * @return {!Promise<void>}
78 */
79async function writeTarget_(filename, fileString, opt_dryrun) {
80 if (opt_dryrun) {
81 log(cyan(`overwriting: ${filename}`));
82 log(fileString);
83 return;
84 }
85 return fs.promises.writeFile(filename, fileString);
86}
87
88/**
89 * @param {string|boolean} value

Callers 2

applyConfigFunction · 0.85
removeConfigFunction · 0.85

Calls 2

cyanFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected