diff --git a/cmd/dev.go b/cmd/dev.go index 58569ab9..c019de33 100644 --- a/cmd/dev.go +++ b/cmd/dev.go @@ -131,6 +131,7 @@ Examples: isDeliberateRestart = true log.Debug("killing project server") dev.KillProjectServer(projectServerCmd) + log.Debug("killing project server done") }) if err != nil { errsystem.New(errsystem.ErrInvalidConfiguration, err, errsystem.WithContextMessage(fmt.Sprintf("Failed to start watcher: %s", err))).ShowErrorAndExit() diff --git a/internal/dev/dev.go b/internal/dev/dev.go index b06cdad2..92acd9d5 100644 --- a/internal/dev/dev.go +++ b/internal/dev/dev.go @@ -16,6 +16,9 @@ import ( ) func KillProjectServer(projectServerCmd *exec.Cmd) { + if projectServerCmd == nil || projectServerCmd.ProcessState == nil || projectServerCmd.ProcessState.Exited() { + return + } ch := make(chan struct{}, 1) go func() { projectServerCmd.Wait() diff --git a/internal/project/project.go b/internal/project/project.go index 6493663c..7fa67eff 100644 --- a/internal/project/project.go +++ b/internal/project/project.go @@ -583,7 +583,7 @@ func ResolveProjectDir(logger logger.Logger, cmd *cobra.Command, required bool) if !ProjectExists(abs) && required { dir = viper.GetString("preferences.project_dir") if ProjectExists(dir) { - tui.ShowWarning("Using your last used project directory. You should change into the correct directory or use the --dir flag.") + tui.ShowWarning("Using your last used project directory (%s). You should change into the correct directory or use the --dir flag.", dir) return dir } tui.ShowBanner("Agentuity Project Not Found", "No Agentuity project file not found in the directory "+abs+"\n\nMake sure you are in an Agentuity project directory or use the --dir flag to specify a project directory.", false)