MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / checkForUpdate

Function checkForUpdate

src/lib/update.ts:184–202  ·  view source on GitHub ↗
(
  currentVersion: string,
  token?: string,
)

Source from the content-addressed store, hash-verified

182 * Check for updates
183 */
184export async function checkForUpdate(
185 currentVersion: string,
186 token?: string,
187): Promise<UpdateCheckResult> {
188 const client = new GitHubClient({
189 token: GitHubClient.resolveToken(token),
190 });
191
192 const release = await client.getLatestRelease(RULESYNC_REPO_OWNER, RULESYNC_REPO_NAME);
193 const latestVersion = normalizeVersion(release.tag_name);
194 const normalizedCurrentVersion = normalizeVersion(currentVersion);
195
196 return {
197 currentVersion: normalizedCurrentVersion,
198 latestVersion,
199 hasUpdate: compareVersions(latestVersion, normalizedCurrentVersion) > 0,
200 release,
201 };
202}
203
204/**
205 * Find asset by name in release

Callers 3

update.test.tsFile · 0.85
performBinaryUpdateFunction · 0.85
updateCommandFunction · 0.85

Calls 4

getLatestReleaseMethod · 0.95
normalizeVersionFunction · 0.85
compareVersionsFunction · 0.85
resolveTokenMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…