rebased on top of master/ updated dist files

This commit is contained in:
Artur Stolear
2020-06-10 12:53:23 +03:00
parent b5f0884321
commit e710d248d1
29 changed files with 937 additions and 1083 deletions

View File

@@ -109,20 +109,23 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
}
public writeGitVersionToAgent(gitversion: GitVersionOutput): void {
let properties = Object.keys(gitversion);
let gitversionOutput = <any> gitversion;
let properties = Object.keys(gitversion)
let gitversionOutput = <any>gitversion
properties.forEach(property => {
const name = this.toCamelCase(property)
const value = gitversionOutput[property]
this.buildAgent.setOutput(name, value);
});
this.buildAgent.setOutput(name, value)
})
}
private toCamelCase(input: string): string {
return input.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) {
if (+match === 0) return ""; // or if (/\s+/.test(match)) for white spaces
return index == 0 ? match.toLowerCase() : match.toUpperCase();
});
return input.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (
match,
index
) {
if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
return index == 0 ? match.toLowerCase() : match.toUpperCase()
})
}
}