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

Function getShellErrorMessage

scripts/prepublish.ts:36–52  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

34}
35
36function getShellErrorMessage(error: unknown): string {
37 if (
38 typeof error === 'object' &&
39 error !== null &&
40 'stderr' in error &&
41 typeof error.stderr === 'string' &&
42 error.stderr.trim()
43 ) {
44 return error.stderr.trim();
45 }
46
47 if (error instanceof Error && error.message.trim()) {
48 return error.message.trim();
49 }
50
51 return 'Unknown git error';
52}
53
54async function getVersionFromGit(): Promise<string> {
55 try {

Callers 1

getVersionFromGitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected