Skip to content

Commit

Permalink
Merge pull request #7 from k1LoW/asset-opt
Browse files Browse the repository at this point in the history
Add option `--release-version` `--os` `--arch`
  • Loading branch information
k1LoW authored Feb 12, 2023
2 parents 94d26cf + 5806bcb commit 9959a17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ var (
force bool
)

var opt = &gh.AssetOption{}

var rootCmd = &cobra.Command{
Use: "gh-setup",
Short: "Setup asset of Github Releases",
Expand All @@ -49,7 +51,7 @@ var rootCmd = &cobra.Command{
if err != nil {
return err
}
a, fsys, err := gh.GetReleaseAsset(ctx, owner, repo, &gh.AssetOption{})
a, fsys, err := gh.GetReleaseAsset(ctx, owner, repo, opt)
if err != nil {
return err
}
Expand Down Expand Up @@ -80,4 +82,7 @@ func init() {
rootCmd.Flags().StringVarP(&ownerrepo, "repo", "R", "", "repository using the OWNER/REPO format")
rootCmd.Flags().StringVarP(&binDir, "bin-dir", "", "", "bin directory for setup")
rootCmd.Flags().BoolVarP(&force, "force", "f", false, "enable force setup")
rootCmd.Flags().StringVarP(&opt.Version, "release-version", "V", "", "release version")
rootCmd.Flags().StringVarP(&opt.OS, "os", "O", "", "specify OS of asset")
rootCmd.Flags().StringVarP(&opt.Arch, "arch", "A", "", "specify arch of asset")
}

0 comments on commit 9959a17

Please sign in to comment.