MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / getVersionFromEnvironment

Function getVersionFromEnvironment

scripts/prepublish.ts:17–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17function getVersionFromEnvironment(): string | null {
18 const candidates = [
19 process.env.RELEASE_VERSION,
20 process.env.CI_COMMIT_TAG,
21 process.env.GITHUB_REF_TYPE === 'tag' ? process.env.GITHUB_REF_NAME : null,
22 process.env.GITHUB_REF?.startsWith('refs/tags/')
23 ? process.env.GITHUB_REF
24 : null,
25 ];
26
27 for (const candidate of candidates) {
28 if (candidate?.trim()) {
29 return normalizeVersion(candidate);
30 }
31 }
32
33 return null;
34}
35
36function getShellErrorMessage(error: unknown): string {
37 if (

Callers 1

resolveVersionFunction · 0.85

Calls 1

normalizeVersionFunction · 0.85

Tested by

no test coverage detected