Skip to content

Commit

Permalink
Fix bitrise support for golang packages (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham149 authored Jan 12, 2023
1 parent 152baae commit d2ef70b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion plugin/bitrise/execer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ func (e *Execer) Exec(ctx context.Context) error {
}
}

module := out.Toolkit.Go.Module
if module == "" {
module = out.Toolkit.Go.PackageName
}
// execute the plugin. the execution logic differs
// based on programming language.
if module := out.Toolkit.Go.Module; module != "" {
if module != "" {
// if the plugin is a Go module

slog.FromContext(ctx).
Expand Down
1 change: 1 addition & 0 deletions plugin/bitrise/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func parse(b []byte) (*spec, error) {
// other default entrypoint or module are
// provided.
if out.Toolkit.Go.Module == "" &&
out.Toolkit.Go.PackageName == "" &&
out.Toolkit.Bash.Entryfile == "" {
out.Toolkit.Bash.Entryfile = "step.sh"
}
Expand Down
3 changes: 2 additions & 1 deletion plugin/bitrise/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ type spec struct {
Entryfile string `yaml:"entry_file"`
}
Go struct {
Module string
Module string
PackageName string `yaml:"package_name"`
}
}
}

0 comments on commit d2ef70b

Please sign in to comment.