Fix bug where reading stdin would cause the install to hang

This commit is contained in:
David Dworken 2022-10-16 09:47:26 -07:00
parent f337d7affd
commit d255131d68
2 changed files with 6 additions and 5 deletions

View File

@ -407,11 +407,11 @@ func ImportHistory(ctx *context.Context) (int, error) {
return 0, fmt.Errorf("failed to parse zsh history: %v", err)
}
historyEntries = append(historyEntries, extraEntries...)
extraEntries, err = readStdin()
if err != nil {
return 0, fmt.Errorf("failed to read stdin: %v", err)
}
historyEntries = append(historyEntries, extraEntries...)
// extraEntries, err = readStdin()
// if err != nil {
// return 0, fmt.Errorf("failed to read stdin: %v", err)
// }
// historyEntries = append(historyEntries, extraEntries...)
db := hctx.GetDb(ctx)
currentUser, err := user.Current()
if err != nil {

View File

@ -73,6 +73,7 @@ func main() {
case "install":
lib.CheckFatalError(lib.Install())
if os.Getenv("HISHTORY_TEST") == "" {
fmt.Println("Importing existing shell history...")
ctx := hctx.MakeContext()
numImported, err := lib.ImportHistory(ctx)
lib.CheckFatalError(err)