Skip to content

Commit

Permalink
[agent] run git checkout if branch is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 26, 2024
1 parent 201e296 commit d6f819e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cmd/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ async function gitClone(url: string, id: string, branch?: string) {
stdout: "inherit",
stderr: "inherit",
});

if (branch) {
await new Deno.Command("pkgx", {
args: ["git", "checkout", branch],
cwd: `${dir("home")}/.fluentci/builds/${id}/${url.split("/").pop()}`,
stdout: "inherit",
stderr: "inherit",
}).spawn().status;
}

await git.spawn().status;
}

Expand Down

0 comments on commit d6f819e

Please sign in to comment.