Skip to content

Commit c03b6d4

Browse files
committed
Fix missing -c arg on switch, only commit changes to project settings
1 parent 696d21f commit c03b6d4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Tasks/UnityBuild/UnityBuildV3/unity-build.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ async function run() {
1818
return;
1919
}
2020

21-
// const buildProjectResult = await UnityBuildProject.run();
22-
const buildProjectResult = 0;
21+
const buildProjectResult = await UnityBuildProject.run();
2322

2423
// Only if the project was built successfully, run the post build
2524
// steps of the versioning tool.

Tasks/UnityBuild/UnityBuildV3/unity-versioning.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
UnityVersioningTools,
2424
} from "@dinomite-studios/unity-azure-pipelines-tasks-lib";
2525
import { BuildPlatform } from "./build-platform";
26+
import path = require("path");
2627

2728
enum VersioningMode {
2829
None = "none",
@@ -57,7 +58,7 @@ export class UnityVersioning {
5758
// HEAD state. So we must make sure to switch to the source branch before
5859
// making any changes to the repository.
5960
const sourceBranchName = tl.getVariable("Build.SourceBranchName")!;
60-
tl.execSync("git", ["switch", sourceBranchName]);
61+
tl.execSync("git", ["switch", "-c", sourceBranchName]);
6162
}
6263

6364
// Does the user want to modify the bundle version?
@@ -294,7 +295,10 @@ export class UnityVersioning {
294295
// Now we can commit the changes.
295296
tl.execSync("git", ["config", "user.name", commitChangesUserName]);
296297
tl.execSync("git", ["config", "user.email", commitChangesUserMail]);
297-
tl.execSync("git", ["add", "."]);
298+
tl.execSync("git", [
299+
"add",
300+
path.join(projectPath, "ProjectSettings", "ProjectSettings.asset"),
301+
]);
298302
tl.execSync("git", ["commit", `-m ${commitMessage}`]);
299303

300304
// Since we pushed to the repository, does the user also want to create a tag?

0 commit comments

Comments
 (0)