diff --git a/backend/env/setup.go b/backend/env/restore.go similarity index 95% rename from backend/env/setup.go rename to backend/env/restore.go index a48ff7f..07ecb30 100644 --- a/backend/env/setup.go +++ b/backend/env/restore.go @@ -14,8 +14,8 @@ import ( pm "github.com/thylong/ian/backend/package-managers" ) -// Setup installs Ian and configuration Ian's environment. -func Setup(OSPackageManager pm.PackageManager) { +// Restore installs Ian and configuration Ian's environment. +func Restore(OSPackageManager pm.PackageManager) { if _, err := os.Stat(OSPackageManager.GetExecPath()); err != nil { log.Infoln("Installing OS package manager...") if err = OSPackageManager.Setup(); err != nil { diff --git a/cmd/env.go b/cmd/env.go index 46f1f41..8f0ed98 100644 --- a/cmd/env.go +++ b/cmd/env.go @@ -15,9 +15,7 @@ var allCmdParam bool func init() { RootCmd.AddCommand(envCmd) - envUpdateCmd.Flags().BoolVarP(&allCmdParam, "all", "a", false, "Run update on all Package managers") - envUpgradeCmd.Flags().BoolVarP(&allCmdParam, "all", "a", false, "Run upgrade on all Package managers") - envCmd.AddCommand( + RootCmd.AddCommand( envAddCmd, envRemoveCmd, envShowCmd, @@ -61,7 +59,7 @@ var envAddCmd = &cobra.Command{ } var envRemoveCmd = &cobra.Command{ - Use: "remove", + Use: "rm", Short: "Remove package(s) to ian configuration", Long: `Remove package(s) to ian env.yml.`, Run: func(cmd *cobra.Command, args []string) { @@ -112,11 +110,7 @@ var envUpdateCmd = &cobra.Command{ Long: `Update the development environment.`, Run: func(cmd *cobra.Command, args []string) { go spinner() - if allCmdParam { - pm.UpdateAllPackageManagers() - return - } - OSPackageManager.UpdateAll() + pm.UpdateAllPackageManagers() }, } @@ -126,11 +120,7 @@ var envUpgradeCmd = &cobra.Command{ Long: `Upgrade the development environment.`, Run: func(cmd *cobra.Command, args []string) { go spinner() - if allCmdParam { - pm.UpgradeAllPackageManagers() - return - } - OSPackageManager.UpgradeAll() + pm.UpgradeAllPackageManagers() }, } diff --git a/cmd/setup.go b/cmd/restore.go similarity index 64% rename from cmd/setup.go rename to cmd/restore.go index e871112..23995d3 100644 --- a/cmd/setup.go +++ b/cmd/restore.go @@ -7,16 +7,16 @@ import ( ) func init() { - RootCmd.AddCommand(setupCmd) + RootCmd.AddCommand(restore) } -// setupCmd represents the setup command -var setupCmd = &cobra.Command{ - Use: "setup", - Short: "Set up ian configuration", +// restore represents the setup command +var restore = &cobra.Command{ + Use: "restore", + Short: "Restore ian configuration", Long: `Ian requires you to be able to interact with Github through Git CLI.`, Run: func(cmd *cobra.Command, args []string) { - env.Setup(OSPackageManager) + env.Restore(OSPackageManager) log.Infoln("Great! You're ready to start using Ian.") }, diff --git a/cmd/self_update.go b/cmd/self_update.go index e1ed0d2..b7ca74c 100644 --- a/cmd/self_update.go +++ b/cmd/self_update.go @@ -99,9 +99,9 @@ var selfUpdateCmd = &cobra.Command{ // Removing backup os.Remove(destBackup) - log.Errorf("ian updated with success to version %s\n", remoteVersion) + log.Infof("ian updated with success to version %s\n", remoteVersion) } else { - log.Errorln("ian is up to date") + log.Infoln("ian is up to date") } }, }