MCPcopy Create free account
hub / github.com/firebase/firebase-tools / absoluteTemplateFilePath

Function absoluteTemplateFilePath

src/templates.ts:12–21  ·  view source on GitHub ↗
(relPath: string)

Source from the content-addressed store, hash-verified

10 * @param relPath file path relative to the /templates directory under root.
11 */
12export function absoluteTemplateFilePath(relPath: string): string {
13 if (isVSCodeExtension()) {
14 // In the VSCE, the /templates directory is copied into dist, which makes it
15 // right next to the compiled files (from various sources including this
16 // TS file). See CopyPlugin in `../firebase-vscode/webpack.common.js`.
17 return resolve(__dirname, "templates", relPath);
18 }
19 // Otherwise, the /templates directory is one level above /src or /lib.
20 return resolve(__dirname, "../templates", relPath);
21}
22
23/**
24 * Read a template file synchronously.

Callers 3

defaultStorageRulesFunction · 0.90
readTemplateSyncFunction · 0.85
readTemplateFunction · 0.85

Calls 2

isVSCodeExtensionFunction · 0.90
resolveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…