-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathNpmExecResult.kt
More file actions
30 lines (23 loc) · 776 Bytes
/
NpmExecResult.kt
File metadata and controls
30 lines (23 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.github.gradle.node.npm.exec
import org.gradle.api.GradleException
import org.gradle.process.ExecResult
class NpmExecResult internal constructor(
val exitValue: Int,
val failure: GradleException?,
val capturedOutput: String,
) {
internal fun asExecResult(): ExecResult = object : ExecResult {
override fun assertNormalExitValue(): ExecResult {
if (failure != null) {
throw failure
}
return this
}
override fun getExitValue(): Int = exitValue
override fun rethrowFailure(): ExecResult {
assertNormalExitValue()
return this
}
}
override fun toString(): String = "NpmExecResult(exitValue=$exitValue, failure=$failure)"
}