Refactor exec calls to use InjectedExecOps

This commit is contained in:
InsanusMokrassar authored and GitHub committed 2026-10-14 18:35:46 +06:00
1 parent 23f8ad316c
commit 68150dd455
1 file changed
+9 -4
+9 -4
View File
@@ -1,9 +1,15 @@
interface InjectedExecOps {
@Inject //@javax.inject.Inject
ExecOperations getExecOps()
}
private String getCurrentVersionChangelog() {
OutputStream changelogDataOS = new ByteArrayOutputStream()
exec {
def injected = project.objects.newInstance(InjectedExecOps)
injected.execOps.exec {
commandLine 'chmod', "+x", './changelog_parser.sh'
}
exec {
injected.execOps.exec {
standardOutput = changelogDataOS
commandLine './changelog_parser.sh', "${project.version}", 'CHANGELOG.md'
}
@@ -11,6 +17,7 @@ private String getCurrentVersionChangelog() {
return changelogDataOS.toString().trim()
}
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
@@ -25,8 +32,6 @@ if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (gith
githubRelease {
token githubReleaseToken
releaseAssets.from('bot/build/distributions')
owner = "InsanusMokrassar"
repo = "PlaguBot"