MCPcopy Create free account
hub / github.com/dataform-co/dataform / readCliVersion

Function readCliVersion

cli/vm/compile.ts:163–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161// Reads the CLI's own version from the package.json baked next to the bundle
162// by pkg_json(version = DF_VERSION). Returns "0.0.0" when unreadable.
163function readCliVersion(): string {
164 try {
165 const pkg = JSON.parse(
166 fs.readFileSync(path.join(__dirname, "package.json"), "utf8")
167 );
168 return pkg.version || "0.0.0";
169 } catch {
170 return "0.0.0";
171 }
172}
173
174// @dataform/core <= 3.0.56 has no `global.__dataform_current_file` fallback in
175// getCallerFile(), so paired with CLI >= 3.0.57 (which uses vm2 with path

Callers 1

compileFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected