( previous: RemoteConnectionState | null, options: Parameters<typeof isCompatibleConnection>[1], )
| 182 | } |
| 183 | |
| 184 | function assertCompatibleConnectionOrForce( |
| 185 | previous: RemoteConnectionState | null, |
| 186 | options: Parameters<typeof isCompatibleConnection>[1], |
| 187 | ): void { |
| 188 | if (!previous || isCompatibleConnection(previous, options)) return; |
| 189 | if (options.flags.force) return; |
| 190 | throw new AppError( |
| 191 | 'INVALID_ARGS', |
| 192 | 'A different remote connection is already active for this session. Re-run connect with --force to replace it.', |
| 193 | { session: options.session, remoteConfig: previous.remoteConfigPath }, |
| 194 | ); |
| 195 | } |
| 196 | |
| 197 | function buildConnectedState(options: { |
| 198 | flags: CliFlags; |
no test coverage detected