()
| 2192 | }; |
| 2193 | |
| 2194 | const printServerProfiles = () => |
| 2195 | Effect.gen(function* () { |
| 2196 | const store = yield* readCliServerConnectionStore(); |
| 2197 | if (store.profiles.length === 0) { |
| 2198 | console.log("No server profiles configured."); |
| 2199 | console.log(`Add one: ${cliPrefix} server add local ${DEFAULT_BASE_URL} --default`); |
| 2200 | return; |
| 2201 | } |
| 2202 | |
| 2203 | const rows = store.profiles.map((profile) => ({ |
| 2204 | marker: profile.name === store.defaultProfile ? "*" : " ", |
| 2205 | name: profile.name, |
| 2206 | kind: profile.connection.kind, |
| 2207 | origin: profile.connection.origin, |
| 2208 | displayName: profile.connection.displayName, |
| 2209 | auth: profile.connection.auth ? "stored-auth" : "env-auth", |
| 2210 | })); |
| 2211 | const nameWidth = rows.reduce((max, row) => Math.max(max, row.name.length), 4); |
| 2212 | const kindWidth = rows.reduce((max, row) => Math.max(max, row.kind.length), 4); |
| 2213 | |
| 2214 | for (const row of rows) { |
| 2215 | console.log( |
| 2216 | `${row.marker} ${row.name.padEnd(nameWidth)} ${row.kind.padEnd(kindWidth)} ${row.origin} ${row.displayName} ${row.auth}`, |
| 2217 | ); |
| 2218 | } |
| 2219 | }); |
| 2220 | |
| 2221 | const serverAddCommand = Command.make( |
| 2222 | "add", |
no test coverage detected