Skip to content

Commit

Permalink
Read profile from restore file
Browse files Browse the repository at this point in the history
  • Loading branch information
kznrluk committed May 18, 2023
1 parent 78b3855 commit cfacc3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/aski.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func Aski(cmd *cobra.Command, args []string) {
fmt.Printf("WARN: File globs are ignored when loading restore.\n")
}

if profileTarget != "" {
fmt.Printf("WARN: Profile is ignored when loading restore.\n")
}

println("Restore conversations from " + fileName)
} else {
ctx = conv.NewConversation(prof)
Expand Down Expand Up @@ -125,7 +129,7 @@ func Aski(cmd *cobra.Command, args []string) {
os.Exit(1)
}
} else {
StartDialog(cfg, prof, ctx, isRestMode, restore != "")
StartDialog(cfg, ctx, isRestMode, restore != "")
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import (
"time"
)

func StartDialog(cfg config.Config, profile config.Profile, cv conv.Conversation, isRestMode bool, restored bool) {
func StartDialog(cfg config.Config, cv conv.Conversation, isRestMode bool, restored bool) {
if isRestMode {
fmt.Printf("REST Mode \n")
}

history := simplehistory.New()

profile := cv.GetProfile()
editor := &readline.Editor{
PromptWriter: func(w io.Writer) (int, error) {
return io.WriteString(w, "\u001B[0m"+profile.UserName+"@"+profile.ProfileName+"> ") // print `$ ` with cyan
Expand Down

0 comments on commit cfacc3f

Please sign in to comment.