Skip to content

Commit

Permalink
Merge pull request #5154 from afh/get-installDir-option
Browse files Browse the repository at this point in the history
Add installDir (-o) option to get command
  • Loading branch information
andydotxyz authored Sep 24, 2024
2 parents 4bc6a6f + e58a9b4 commit 56901bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/fyne/internal/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ func Get() *cli.Command {
Usage: "For darwin and Windows targets an appID in the form of a reversed domain name is required, for ios this must match a valid provisioning profile",
Destination: &g.AppID,
},
&cli.StringFlag{
Name: "installDir",
Aliases: []string{"o"},
Usage: "A specific location to install to, rather than the OS default.",
Destination: &g.installDir,
},
},
Action: func(ctx *cli.Context) error {
if ctx.Args().Len() != 1 {
Expand All @@ -50,6 +56,7 @@ func Get() *cli.Command {
// Getter is the command that can handle downloading and installing Fyne apps to the current platform.
type Getter struct {
*appData
installDir string
}

// NewGetter returns a command that can handle the download and install of GUI apps built using Fyne.
Expand Down Expand Up @@ -98,7 +105,7 @@ func (g *Getter) Get(pkg string) error {
path = filepath.Join(path, dir)
}

install := &Installer{appData: g.appData, srcDir: path, release: true}
install := &Installer{appData: g.appData, installDir: g.installDir, srcDir: path, release: true}
if err := install.validate(); err != nil {
return fmt.Errorf("failed to set up installer: %w", err)
}
Expand Down

0 comments on commit 56901bb

Please sign in to comment.