Skip to content

Commit

Permalink
Add a mainBranch configuration for the plugin
Browse files Browse the repository at this point in the history
Summary: See #2

Differential Revision: https://phabricator.tdrhq.com/D10062
  • Loading branch information
tdrhq committed Sep 20, 2024
1 parent 26c5596 commit 15596a7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ protected void prepareTask(Task task, Project project, String mode) {
it.mode = mode;
it.hostname = extension.getHostname();
it.batch = extension.getBatch();
it.mainBranch = extension.getMainBranch();

it.mustRunAfter(inputTaskName);
it.doFirst((innerTask) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ public String getBatch() {
public void setBatch(String batch) {
this.batch = batch;
}

public String getMainBranch() {
return mainBranch;
}

public void setMainBranch(String mainBranch) {
this.mainBranch = mainBranch;
}

private String mainBranch;

}
@Override
public void apply(Project target) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class UploadScreenshotsTask extends BaseRecorderTask {
public String mode = "record";
public String batch = null;

public String mainBranch = null;

@Inject
public UploadScreenshotsTask(ExecOperations execOperations) {
super(execOperations);
Expand Down Expand Up @@ -48,6 +50,10 @@ public void uploadChannel() {
args.add(this.batch);
}

if (this.mainBranch != null && this.mainBranch.length() > 0) {
args.add("--main-branch");
args.add(this.mainBranch);
}
it.setArgs(args);
});
}
Expand Down

0 comments on commit 15596a7

Please sign in to comment.