-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1086 from twpayne/upgrade-cmd
Restore upgrade command
- Loading branch information
Showing
8 changed files
with
653 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type upgradeCmdConfig struct { | ||
method string | ||
owner string | ||
repo string | ||
} | ||
|
||
func (c *Config) newUpgradeCmd() *cobra.Command { | ||
upgradeCmd := &cobra.Command{ | ||
Use: "upgrade", | ||
Short: "Upgrade chezmoi to the latest released version", | ||
Long: mustLongHelp("upgrade"), | ||
Example: example("upgrade"), | ||
Args: cobra.NoArgs, | ||
RunE: c.runUpgradeCmd, | ||
Annotations: map[string]string{ | ||
runsCommands: "true", | ||
}, | ||
} | ||
|
||
flags := upgradeCmd.Flags() | ||
flags.StringVar(&c.upgrade.method, "method", "", "set method") | ||
flags.StringVar(&c.upgrade.owner, "owner", "twpayne", "set owner") | ||
flags.StringVar(&c.upgrade.repo, "repo", "chezmoi", "set repo") | ||
|
||
return upgradeCmd | ||
} |
Oops, something went wrong.