@@ -4,7 +4,13 @@ import Spinner from 'ink-spinner';
44import { splitEvery } from 'ramda' ;
55import { ReactNode , useCallback , useEffect , useMemo , useState } from 'react' ;
66
7- import { AppStates , LogSource , logoText , terminatedText } from './constants.js' ;
7+ import {
8+ AppStates ,
9+ LogSource ,
10+ READY_MESSAGES ,
11+ logoText ,
12+ terminatedText
13+ } from './constants.js' ;
814import { useAppContext , AppContextProvider } from './hooks/useAppContext.js' ;
915import { useLogsFromAllSources } from './hooks/useLogsFromAllSources.js' ;
1016import { getLineLimit } from './utils/line-limit.js' ;
@@ -95,18 +101,16 @@ const CliUi = () => {
95101 runCommand ( 'docker-compose' , [ 'down' ] , runCommandOpts ) ;
96102 } ;
97103
98- runCommand (
99- 'docker-compose' ,
100- [ '--progress=plain' , 'up' , '-d' ] ,
101- runCommandOpts
102- )
103- . promise . then ( ( ) => {
104- addLog ( '\n🚀 Container ready 🚀\n' ) ;
105- setAppState ( AppStates . DOCKER_READY ) ;
106- } )
107- . catch ( ( err ) => {
108- addLog ( [ '❌ Container boot failure ❌' , `Error logs: ${ err . message } ` ] ) ;
109- } ) ;
104+ runCommand ( 'docker-compose' , [ 'watch' ] , runCommandOpts ) . process ?. stdout . on (
105+ 'data' ,
106+ ( data ) => {
107+ let watch_logs = String ( data ) ;
108+ if ( watch_logs . includes ( READY_MESSAGES [ LogSource . DockerWatch ] ) ) {
109+ addLog ( '\n🚀 Container ready 🚀\n' ) ;
110+ setAppState ( AppStates . DOCKER_READY ) ;
111+ }
112+ }
113+ ) ;
110114
111115 process . on ( 'exit' , listener ) ;
112116 return ( ) => {
0 commit comments