Skip to content

Commit aea44a8

Browse files
authored
Just use new Seam() for examples (#397)
1 parent 8da8ad2 commit aea44a8

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

examples/index.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env tsx
22

3-
import { env } from 'node:process'
4-
53
import landlubber, {
64
type DefaultContext,
75
defaultMiddleware,
@@ -27,17 +25,9 @@ interface ClientContext {
2725
const commands = [locks, unlock, workspace]
2826

2927
const createAppContext: MiddlewareFunction = async (argv) => {
30-
const apiKey = argv['api-key']
31-
if (typeof apiKey !== 'string') throw new Error('Missing Seam API key')
32-
const seam = SeamHttp.fromApiKey(apiKey)
33-
argv['seam'] = seam
28+
argv['seam'] = new SeamHttp()
3429
}
3530

3631
const middleware = [...defaultMiddleware, createAppContext]
3732

38-
await landlubber<Context>(commands, { middleware })
39-
.describe('api-key', 'Seam API key')
40-
.string('api-key')
41-
.default('api-key', env.SEAM_API_KEY, 'SEAM_API_KEY')
42-
.demandOption('api-key')
43-
.parse()
33+
await landlubber<Context>(commands, { middleware }).parse()

0 commit comments

Comments
 (0)