Skip to content

Commit dc5df99

Browse files
committed
[feat]: [CI-17150]: issue fix
1 parent a4f1be4 commit dc5df99

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

main.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,19 @@ func main() {
109109
case kind == "harness" || (kind == "" && harness.Is(codedir)):
110110
if !disableClone {
111111
slog.Info("detected harness plugin.yml")
112+
} else {
113+
slog.Info("clone is disabled for harness plugin")
112114
}
113115
execer := harness.Execer{
114-
Source: codedir,
115-
Workdir: workdir,
116-
Ref: ref,
117-
Environ: os.Environ(),
118-
Stdout: os.Stdout,
119-
Stderr: os.Stderr,
120-
DownloadOnly: downloadOnly,
116+
Source: codedir,
117+
Workdir: workdir,
118+
Ref: ref,
119+
Environ: os.Environ(),
120+
Stdout: os.Stdout,
121+
Stderr: os.Stderr,
122+
BinarySources: binarySources,
123+
DisableClone: disableClone,
124+
DownloadOnly: downloadOnly,
121125
}
122126
if err := execer.Exec(ctx); err != nil {
123127
slog.Error("step failed", "error", err)

plugin/harness/execer.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ type Execer struct {
2626
Source string // plugin source code directory
2727
Workdir string // pipeline working directory (aka workspace)
2828
DownloadOnly bool
29-
binarySources utils.CustomStringSliceFlag
30-
disableClone bool
29+
BinarySources utils.CustomStringSliceFlag
30+
DisableClone bool
3131
Environ []string
3232
Stdout io.Writer
3333
Stderr io.Writer
3434
}
3535

3636
// Exec executes a bitrise plugin.
3737
func (e *Execer) Exec(ctx context.Context) error {
38-
if !e.disableClone {
38+
if !e.DisableClone {
3939
// parse the bitrise plugin yaml
4040
out, err := parseFile(filepath.Join(e.Source, "plugin.yml"))
4141
if err != nil {
@@ -65,8 +65,8 @@ func (e *Execer) Exec(ctx context.Context) error {
6565
} else {
6666
return e.runShellExecutable(ctx, out)
6767
}
68-
} else if len(e.binarySources.GetValue()) > 0 {
69-
return e.runSourceExecutable(ctx, e.binarySources.GetValue())
68+
} else if len(e.BinarySources.GetValue()) > 0 {
69+
return e.runSourceExecutable(ctx, e.BinarySources.GetValue())
7070
} else {
7171
slog.Error("clone is disabled and binary sources are empty. Aborting")
7272
return nil
@@ -286,8 +286,8 @@ func runCmds(ctx context.Context, cmds []*exec.Cmd, env []string, workdir string
286286

287287
func (e *Execer) getBinarySources(source string, fallback string) []string {
288288
var sources []string
289-
if len(e.binarySources.GetValue()) > 0 {
290-
sources = append(sources, e.binarySources.GetValue()...)
289+
if len(e.BinarySources.GetValue()) > 0 {
290+
sources = append(sources, e.BinarySources.GetValue()...)
291291
}
292292
if source != "" {
293293
sources = append(sources, source)

0 commit comments

Comments
 (0)