mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Add support to skip modifying shell configs during the hishtory update process, since the shell configs are already set up at that point and haven't ever needed to change (#259)
* Skip modifying shell configs during the hishtory update process, since the shell configs are already set up at that point and haven't ever needed to change * Use separate flag for skipping update config mods to enable future flexibility * Revert the update change since that needs to be in a separate release
This commit is contained in:
parent
e96993b673
commit
905afd91c3
@ -26,10 +26,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
offlineInit *bool
|
||||
forceInit *bool
|
||||
offlineInstall *bool
|
||||
skipConfigModification *bool
|
||||
offlineInit *bool
|
||||
forceInit *bool
|
||||
offlineInstall *bool
|
||||
skipConfigModification *bool
|
||||
skipUpdateConfigModification *bool
|
||||
|
||||
//lint:ignore U1000 Flag that is allowed to be specified, but not used
|
||||
currentlyInstalledVersion *string
|
||||
)
|
||||
|
||||
var installCmd = &cobra.Command{
|
||||
@ -45,7 +49,7 @@ var installCmd = &cobra.Command{
|
||||
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))
|
||||
}
|
||||
lib.CheckFatalError(install(secretKey, *offlineInstall, *skipConfigModification))
|
||||
lib.CheckFatalError(install(secretKey, *offlineInstall, *skipConfigModification || *skipUpdateConfigModification))
|
||||
if os.Getenv("HISHTORY_SKIP_INIT_IMPORT") == "" {
|
||||
db, err := hctx.OpenLocalSqliteDb()
|
||||
lib.CheckFatalError(err)
|
||||
@ -686,4 +690,6 @@ func init() {
|
||||
forceInit = initCmd.Flags().Bool("force", false, "Force re-init without any prompts")
|
||||
offlineInstall = installCmd.Flags().Bool("offline", false, "Install hiSHtory in offline mode with all syncing capabilities disabled")
|
||||
skipConfigModification = installCmd.Flags().Bool("skip-config-modification", false, "Skip modifying shell configs and instead instruct the user on how to modify their configs")
|
||||
skipUpdateConfigModification = installCmd.Flags().Bool("skip-update-config-modification", false, "Skip modifying shell configs for updates")
|
||||
currentlyInstalledVersion = installCmd.Flags().String("currently-installed-version", "", "The currently installed version (used by the update command)")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user