( client: Client, exitCode: number, command?: string )
| 28 | } |
| 29 | |
| 30 | export async function canAutoUpdate( |
| 31 | client: Client, |
| 32 | exitCode: number, |
| 33 | command?: string |
| 34 | ) { |
| 35 | if (isNativeBinaryInstall()) { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | if (!isAutoUpdateEnabled(client.config)) { |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | if (exitCode !== 0) { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | if (ciInfo.isCI) { |
| 48 | return false; |
| 49 | } |
| 50 | |
| 51 | if (client.nonInteractive || client.isAgent) { |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | if (command === 'upgrade') { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | return isGlobal(); |
| 60 | } |
no test coverage detected