File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,26 @@ pub async fn handle_stop() -> Result<(), Box<dyn std::error::Error>> {
227227}
228228
229229pub async fn handle_upgrade ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
230- println ! ( "{} Upgrading local Canine environment..." , "→" . cyan( ) ) ;
230+ if !docker_compose_path ( ) . exists ( ) {
231+ println ! ( "{} Local Canine environment is not installed" , "✗" . red( ) ) ;
232+ println ! ( " Run {} to install" , "canine local start" . cyan( ) ) ;
233+ std:: process:: exit ( 1 ) ;
234+ }
235+
236+ println ! ( "{} Pulling latest images..." , "→" . cyan( ) ) ;
237+
238+ let status = Command :: new ( "docker" )
239+ . args ( [ "compose" , "pull" ] )
240+ . current_dir ( local_dir ( ) )
241+ . status ( ) ?;
242+
243+ if status. success ( ) {
244+ println ! ( "{} Images updated successfully" , "✓" . green( ) ) ;
245+ println ! ( " Run {} to apply the upgrade" , "canine local start" . cyan( ) ) ;
246+ } else {
247+ println ! ( "{} Failed to pull images" , "✗" . red( ) ) ;
248+ std:: process:: exit ( 1 ) ;
249+ }
250+
231251 Ok ( ( ) )
232252}
You can’t perform that action at this time.
0 commit comments