Skip to content

Commit

Permalink
Add support to skip modifying shell configs during the hishtory updat…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
ddworken authored Oct 20, 2024
1 parent e96993b commit 905afd9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions client/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
Expand Down Expand Up @@ -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)")
}

0 comments on commit 905afd9

Please sign in to comment.