-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement JReleaserCatalog command
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { CommandResponse } from '.'; | ||
import * as toolrunner from 'azure-pipelines-task-lib/toolrunner'; | ||
import * as tasks from 'azure-pipelines-task-lib/task'; | ||
import { ITaskContext } from '../context'; | ||
import { AbstractPlatformAwareModelCommand } from './abstractPlatformAwareModelCommand'; | ||
|
||
export class JReleaserCatalog extends AbstractPlatformAwareModelCommand { | ||
constructor(toolrunner: toolrunner.ToolRunner) { | ||
super(toolrunner); | ||
} | ||
|
||
protected setup(ctx: ITaskContext): void { | ||
this.options.unshift('catalog'); | ||
} | ||
|
||
exec(): Promise<CommandResponse> { | ||
for (const option of this.options) { | ||
this.toolrunner.arg(option); | ||
} | ||
tasks.debug(`Running JReleaser with options: ${this.options.join(' ')}`); | ||
|
||
const runnerResult = this.toolrunner.execSync(); | ||
if (runnerResult.code === 0) { | ||
return Promise.resolve(new CommandResponse(0)); | ||
} else { | ||
return Promise.reject( | ||
new CommandResponse( | ||
1, | ||
`Failed to initialize JReleaser. Exit code: ${runnerResult.code}`, | ||
), | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters