mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Add sanity checking to ensure we don't ever have a bug that uses flags as secret keys
This commit is contained in:
parent
da53939cf8
commit
06424dfca8
@ -42,7 +42,10 @@ var installCmd = &cobra.Command{
|
|||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
secretKey = args[0]
|
secretKey = args[0]
|
||||||
}
|
}
|
||||||
lib.CheckFatalError(install(secretKey, *offlineInstall, *skipConfigModification))
|
if strings.HasPrefix(secretKey, "-") {
|
||||||
|
lib.CheckFatalError(fmt.Errorf("secret key %#v looks like a CLI flag, please use a secret key that does not start with a -", secretKey))
|
||||||
|
}
|
||||||
|
// TODO: Add a check to crash if secretKey looks like a flag lib.CheckFatalError(install(secretKey, *offlineInstall, *skipConfigModification))
|
||||||
if os.Getenv("HISHTORY_SKIP_INIT_IMPORT") == "" {
|
if os.Getenv("HISHTORY_SKIP_INIT_IMPORT") == "" {
|
||||||
db, err := hctx.OpenLocalSqliteDb()
|
db, err := hctx.OpenLocalSqliteDb()
|
||||||
lib.CheckFatalError(err)
|
lib.CheckFatalError(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user