MCPcopy Create free account
hub / github.com/adobe/react-spectrum / resolveTag

Function resolveTag

scripts/changelog.js:160–173  ·  view source on GitHub ↗
(pkgName, pkgVersion)

Source from the content-addressed store, hash-verified

158}
159
160function resolveTag(pkgName, pkgVersion) {
161 let exact = `${pkgName}@${pkgVersion}`;
162 let check = spawn('git', ['rev-parse', '--verify', exact], {encoding: 'utf8'});
163 if (check.status === 0) {
164 return exact;
165 }
166 // Exact tag doesn't exist (e.g. a patch bump without a new tag) — fall back to the
167 // most recent tag for this package using git's version sort.
168 let list = spawn('git', ['tag', '-l', '--sort=version:refname', `${pkgName}@*`], {
169 encoding: 'utf8'
170 });
171 let tags = list.stdout.trim().split('\n').filter(Boolean);
172 return tags.length > 0 ? tags[tags.length - 1] : null;
173}
174
175async function renderCommitLine(commit) {
176 let message = '';

Callers 1

runFunction · 0.85

Calls 1

filterMethod · 0.65

Tested by

no test coverage detected