(options: {
stateDir: string;
flags: CliFlags;
remoteConfigPath: string;
})
| 162 | }; |
| 163 | |
| 164 | function resolveConnectContext(options: { |
| 165 | stateDir: string; |
| 166 | flags: CliFlags; |
| 167 | remoteConfigPath: string; |
| 168 | }): ConnectContext { |
| 169 | const { stateDir, flags, remoteConfigPath } = options; |
| 170 | const activeState = flags.session ? null : readActiveConnectionState({ stateDir }); |
| 171 | const session = flags.session ?? activeState?.session ?? createRemoteSessionName(stateDir); |
| 172 | const previous = |
| 173 | activeState?.session === session |
| 174 | ? activeState |
| 175 | : readRemoteConnectionState({ stateDir, session }); |
| 176 | return { |
| 177 | session, |
| 178 | previous, |
| 179 | remoteConfigHash: hashRemoteConfigFile(remoteConfigPath), |
| 180 | daemon: buildDaemonState(flags), |
| 181 | }; |
| 182 | } |
| 183 | |
| 184 | function assertCompatibleConnectionOrForce( |
| 185 | previous: RemoteConnectionState | null, |
no test coverage detected