File tree Expand file tree Collapse file tree
plugins/serverless/src/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { Task, TaskRunContext } from '@dotcom-tool-kit/base'
22import type ServerlessSchema from '../schema'
33import { ChildProcess , spawn } from 'child_process'
44import { DopplerEnvVars } from '@dotcom-tool-kit/doppler'
5- import { hookConsole , hookFork } from '@dotcom-tool-kit/logger'
5+ import { hookConsole , hookFork , waitOnExit } from '@dotcom-tool-kit/logger'
66import getPort from 'get-port'
77import waitPort from 'wait-port'
88import * as z from 'zod'
9+ import { writeState } from '@dotcom-tool-kit/state'
910
1011const ServerlessRunSchema = z
1112 . object ( {
@@ -71,11 +72,15 @@ export default class ServerlessRun extends Task<{
7172 try {
7273 await waitPort ( {
7374 host : 'localhost' ,
74- port : port
75+ port
7576 } )
7677 } finally {
7778 unhook ( )
7879 }
80+
81+ writeState ( 'local' , { port } )
82+
83+ await waitOnExit ( 'serverless' , this . child )
7984 }
8085
8186 async stop ( ) {
You can’t perform that action at this time.
0 commit comments