MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / fetchGitHead

Function fetchGitHead

packages/bumpy/src/core/prerelease.ts:66–76  ·  view source on GitHub ↗

Fetch the gitHead recorded for a published version (set by npm publish from a git checkout)

(name: string, version: string, registry?: string)

Source from the content-addressed store, hash-verified

64
65/** Fetch the gitHead recorded for a published version (set by npm publish from a git checkout) */
66async function fetchGitHead(name: string, version: string, registry?: string): Promise<string | null> {
67 const args = ['npm', 'info', `${name}@${version}`, 'gitHead'];
68 if (registry) args.push('--registry', registry);
69 try {
70 const result = await runArgsAsync(args);
71 const sha = result.trim();
72 return /^[0-9a-f]{40}$/.test(sha) ? sha : null;
73 } catch {
74 return null;
75 }
76}
77
78/** Whether a package publishes through the npm registry (vs custom command / git-tag tracking) */
79export function usesNpmRegistry(pkg: WorkspacePackage): boolean {

Callers 1

buildChannelReleasePlanFunction · 0.85

Calls 1

runArgsAsyncFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…