Skip to content

Commit

Permalink
Merge pull request #2067 from torkjel/patch-1
Browse files Browse the repository at this point in the history
sbt: Avoid clobbering unrelated version settings
  • Loading branch information
hipstersmoothie authored Jan 20, 2022
2 parents 59b42d6 + a208ce7 commit 6159c24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plugins/sbt/__tests__/sbt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("sbt plugin", () => {
expect(exec).toHaveBeenCalledTimes(2);
expect(exec).lastCalledWith("sbt", [
"--client",
'set every version := \\"0.1.0\\"',
'set ThisBuild / version := \\"0.1.0\\"',
]);
});
});
Expand Down Expand Up @@ -159,7 +159,7 @@ describe("sbt plugin", () => {

expect(exec).not.toHaveBeenCalledWith("sbt", [
"--client",
'set every version := \\"0.1.0\\"',
'set ThisBuild / version := \\"0.1.0\\"',
]);

expect(result).toMatchObject({
Expand Down Expand Up @@ -187,7 +187,7 @@ describe("sbt plugin", () => {

expect(exec).toHaveBeenCalledWith("sbt", [
"--client",
`set every version := \\"${newVersion}\\"`,
`set ThisBuild / version := \\"${newVersion}\\"`,
]);

expect(result).toMatchObject({ newVersion });
Expand Down
2 changes: 1 addition & 1 deletion plugins/sbt/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function sbtGetVersion(): Promise<string> {

/** Set version in sbt to the given value */
export async function sbtSetVersion(version: string): Promise<string> {
return sbtClient(`set every version := \\"${version}\\"`);
return sbtClient(`set ThisBuild / version := \\"${version}\\"`);
}

/** Run sbt publish */
Expand Down

0 comments on commit 6159c24

Please sign in to comment.