Find last json blob in gitversion stdout instead of first

This commit is contained in:
Lasse Valentini Jensen
2021-06-16 14:53:13 +02:00
committed by Artur
parent 2e44bffa9c
commit c25ec1dc11

View File

@@ -42,8 +42,8 @@ export async function run() {
const result = await gitVersionTool.run(settings)
const { stdout } = result
const jsonOutput = stdout.substring(
stdout.indexOf('{'),
stdout.indexOf('}') + 1
stdout.lastIndexOf('{'),
stdout.lastIndexOf('}') + 1
)
const gitversion = JSON.parse(jsonOutput) as GitVersionOutput