Skip to content

Commit

Permalink
Merge pull request #813 from GitTools/bug/730
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Mar 11, 2023
1 parent 1a99526 commit b30860f
Show file tree
Hide file tree
Showing 28 changed files with 172 additions and 29 deletions.
4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/addasset/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/close/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/discard/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/open/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/publish/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/azure/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/azure/gitversion/execute/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/azure/gitversion/setup/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/addasset/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/close/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/discard/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/open/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/publish/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/github/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/github/gitversion/execute/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/github/gitversion/setup/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/addasset/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/close/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/create/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/discard/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/open/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/publish/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/mock/gitreleasemanager/setup/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/mock/gitversion/execute/bundle.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions dist/mock/gitversion/setup/bundle.js

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions src/tasks/gitversion/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ export async function run() {
const settings: GitVersionSettings = settingsProvider.getGitVersionSettings()

const result = await gitVersionTool.run(settings)
const { stdout } = result
const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)

const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
gitVersionTool.writeGitVersionToAgent(gitversion)

if (result.code === 0) {
buildAgent.setSucceeded('GitVersion executed successfully', true)
const { stdout } = result

if (stdout.lastIndexOf('{') === -1 || stdout.lastIndexOf('}') === -1) {
buildAgent.setFailed('GitVersion output is not valid JSON', true)
} else {
const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)

const gitversion = JSON.parse(jsonOutput) as GitVersionOutput
gitVersionTool.writeGitVersionToAgent(gitversion)
}
} else {
buildAgent.setFailed(result.error.message, true)
}
Expand Down

0 comments on commit b30860f

Please sign in to comment.