mirror of
https://github.com/ddworken/hishtory.git
synced 2025-07-01 05:01:08 +02:00
Fix test failures caused by the cobra install command not respecting the secret key
Also added a persistLog() function so that I can easily inspect the hishtory logs from test runs.
This commit is contained in:
@ -652,7 +652,7 @@ func readFileToArray(path string) ([]string, error) {
|
||||
return lines, nil
|
||||
}
|
||||
|
||||
func Install(offline bool) error {
|
||||
func Install(secretKey string, offline bool) error {
|
||||
homedir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get user's home directory: %v", err)
|
||||
@ -683,8 +683,8 @@ func Install(offline bool) error {
|
||||
}
|
||||
_, err = hctx.GetConfig()
|
||||
if err != nil {
|
||||
// No config, so set up a new installation with a new key
|
||||
return Setup("", offline)
|
||||
// No config, so set up a new installation
|
||||
return Setup(secretKey, offline)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user