Skip to content

Commit

Permalink
Include create-dmg parameters (#11)
Browse files Browse the repository at this point in the history
* config create-dmg parameters

* rebase and re-generate bindata
  • Loading branch information
kaichaosun authored May 17, 2024
1 parent 798a803 commit 361e898
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 78 deletions.
13 changes: 9 additions & 4 deletions cmd/gon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,15 @@ func realMain() int {
color.New(color.Bold).Fprintf(os.Stdout, "==> %s Creating dmg...\n", iconPackage)
color.New().Fprintf(os.Stdout, " This will open Finder windows momentarily.\n")
err = dmg.Dmg(context.Background(), &dmg.Options{
Files: cfg.Source,
OutputPath: cfg.Dmg.OutputPath,
VolumeName: cfg.Dmg.VolumeName,
Logger: logger.Named("dmg"),
Files: cfg.Source,
OutputPath: cfg.Dmg.OutputPath,
VolumeName: cfg.Dmg.VolumeName,
WindowPos: cfg.Dmg.WindowPos,
WindowSize: cfg.Dmg.WindowSize,
IconSize: cfg.Dmg.IconSize,
Icon: cfg.Dmg.Icon,
AppDropLink: cfg.Dmg.AppDropLink,
Logger: logger.Named("dmg"),
})
if err != nil {
fmt.Fprintf(os.Stdout, color.RedString("❗️ Error creating dmg:\n\n%s\n", err))
Expand Down
15 changes: 15 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ type Dmg struct {
// Volume name is the name of the volume that shows up in the title
// and sidebar after opening it.
VolumeName string `hcl:"volume_name"`

// Set position the folder window
WindowPos []string `hcl:"window_pos,optional"`

// Set size of the folder window
WindowSize []string `hcl:"window_size,optional"`

// Set window icons size
IconSize string `hcl:"icon_size,optional"`

// Set position of the file's icon
Icon []string `hcl:"icon,optional"`

// make a drop link to Applications, at location x, y
AppDropLink []string `hcl:"app_drop_link,optional"`
}

// Zip are the options for a zip file as output.
Expand Down
Loading

0 comments on commit 361e898

Please sign in to comment.