mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-27 07:22:29 +02:00
Fix bug where reading stdin would cause the install to hang
This commit is contained in:
parent
f337d7affd
commit
d255131d68
@ -407,11 +407,11 @@ func ImportHistory(ctx *context.Context) (int, error) {
|
|||||||
return 0, fmt.Errorf("failed to parse zsh history: %v", err)
|
return 0, fmt.Errorf("failed to parse zsh history: %v", err)
|
||||||
}
|
}
|
||||||
historyEntries = append(historyEntries, extraEntries...)
|
historyEntries = append(historyEntries, extraEntries...)
|
||||||
extraEntries, err = readStdin()
|
// extraEntries, err = readStdin()
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return 0, fmt.Errorf("failed to read stdin: %v", err)
|
// return 0, fmt.Errorf("failed to read stdin: %v", err)
|
||||||
}
|
// }
|
||||||
historyEntries = append(historyEntries, extraEntries...)
|
// historyEntries = append(historyEntries, extraEntries...)
|
||||||
db := hctx.GetDb(ctx)
|
db := hctx.GetDb(ctx)
|
||||||
currentUser, err := user.Current()
|
currentUser, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -73,6 +73,7 @@ func main() {
|
|||||||
case "install":
|
case "install":
|
||||||
lib.CheckFatalError(lib.Install())
|
lib.CheckFatalError(lib.Install())
|
||||||
if os.Getenv("HISHTORY_TEST") == "" {
|
if os.Getenv("HISHTORY_TEST") == "" {
|
||||||
|
fmt.Println("Importing existing shell history...")
|
||||||
ctx := hctx.MakeContext()
|
ctx := hctx.MakeContext()
|
||||||
numImported, err := lib.ImportHistory(ctx)
|
numImported, err := lib.ImportHistory(ctx)
|
||||||
lib.CheckFatalError(err)
|
lib.CheckFatalError(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user