added prettier tool
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import "reflect-metadata";
|
||||
import { run } from "./main";
|
||||
import 'reflect-metadata'
|
||||
import {run} from './main'
|
||||
|
||||
run();
|
||||
run()
|
||||
|
||||
@@ -1,50 +1,55 @@
|
||||
import { IBuildAgent, TYPES, SetupFields } from "../../core/models";
|
||||
import { Settings as CommonSettings } from "../../core/settings";
|
||||
import { Settings } from "../../tools/gitversion/settings";
|
||||
import { IGitVersionTool, GitVersionTool } from "../../tools/gitversion/tool";
|
||||
import { GitVersionSettings, GitVersionOutput } from "../../tools/gitversion/models";
|
||||
import {IBuildAgent, TYPES, SetupFields} from '../../core/models'
|
||||
import {Settings as CommonSettings} from '../../core/settings'
|
||||
import {Settings} from '../../tools/gitversion/settings'
|
||||
import {IGitVersionTool, GitVersionTool} from '../../tools/gitversion/tool'
|
||||
import {
|
||||
GitVersionSettings,
|
||||
GitVersionOutput
|
||||
} from '../../tools/gitversion/models'
|
||||
|
||||
import container from "../../core/ioc";
|
||||
import container from '../../core/ioc'
|
||||
|
||||
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool);
|
||||
container.bind<IGitVersionTool>(TYPES.IGitVersionTool).to(GitVersionTool)
|
||||
|
||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool);
|
||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent);
|
||||
const gitVersionTool = container.get<IGitVersionTool>(TYPES.IGitVersionTool)
|
||||
const buildAgent = container.get<IBuildAgent>(TYPES.IBuildAgent)
|
||||
|
||||
export async function setup() {
|
||||
try {
|
||||
gitVersionTool.disableTelemetry()
|
||||
|
||||
gitVersionTool.disableTelemetry();
|
||||
const settings = CommonSettings.getSetupSettings(buildAgent)
|
||||
|
||||
const settings = CommonSettings.getSetupSettings(buildAgent);
|
||||
await gitVersionTool.install(
|
||||
settings.versionSpec,
|
||||
settings.includePrerelease
|
||||
)
|
||||
|
||||
await gitVersionTool.install(settings.versionSpec, settings.includePrerelease);
|
||||
|
||||
buildAgent.setSucceeded("GitVersion installed successfully", true);
|
||||
buildAgent.setSucceeded('GitVersion installed successfully', true)
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error.message, true);
|
||||
buildAgent.setFailed(error.message, true)
|
||||
}
|
||||
}
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
gitVersionTool.disableTelemetry()
|
||||
|
||||
gitVersionTool.disableTelemetry();
|
||||
const settings: GitVersionSettings = Settings.getGitVersionSettings(
|
||||
buildAgent
|
||||
)
|
||||
|
||||
const settings: GitVersionSettings = Settings.getGitVersionSettings(buildAgent);
|
||||
const result = await gitVersionTool.run(settings)
|
||||
|
||||
const result = await gitVersionTool.run(settings);
|
||||
|
||||
const gitversion = JSON.parse(result.stdout) as GitVersionOutput;
|
||||
gitVersionTool.writeGitVersionToAgent(gitversion);
|
||||
const gitversion = JSON.parse(result.stdout) as GitVersionOutput
|
||||
gitVersionTool.writeGitVersionToAgent(gitversion)
|
||||
|
||||
if (result.code === 0) {
|
||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
||||
buildAgent.setSucceeded('GitVersion executed successfully', true)
|
||||
} else {
|
||||
buildAgent.setFailed(result.error.message, true);
|
||||
buildAgent.setFailed(result.error.message, true)
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
buildAgent.setFailed(error, true);
|
||||
buildAgent.setFailed(error, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import "reflect-metadata";
|
||||
import { setup } from "./main";
|
||||
import 'reflect-metadata'
|
||||
import {setup} from './main'
|
||||
|
||||
setup();
|
||||
setup()
|
||||
|
||||
Reference in New Issue
Block a user