Skip to content

Commit

Permalink
[Gradle Release Plugin] - pre tag commit: 'v1.3.1'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Jul 2, 2022
2 parents cf228da + 1254a2c commit 4304e1b
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 15 deletions.
65 changes: 56 additions & 9 deletions build/distributions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162408,10 +162408,11 @@ module.exports = v4;
var startGroup = $module$_actions_core.startGroup;
var endGroup = $module$_actions_core.endGroup;
var which = $module$_actions_io.which;
var StringBuilder_init = Kotlin.kotlin.text.StringBuilder_init;
var contains = Kotlin.kotlin.text.contains_li3zpu$;
var mkdirP = $module$_actions_io.mkdirP;
var isDebug = $module$_actions_core.isDebug;
var replace = Kotlin.kotlin.text.replace_680rmw$;
var contains = Kotlin.kotlin.text.contains_li3zpu$;
var trimIndent = Kotlin.kotlin.text.trimIndent_pdl1vz$;
var lines = Kotlin.kotlin.text.lines_gw00vp$;
var writeFileSync = $module$fs.writeFileSync;
Expand Down Expand Up @@ -165004,9 +165005,27 @@ module.exports = v4;
else
return instance.doResume(null);
}
function installDistribution$lambda$lambda$lambda(closure$stdoutBuilder, closure$stdoutBuilderUtf16Le) {
return function (it) {
closure$stdoutBuilder.append_s8jyv4$(it);
closure$stdoutBuilderUtf16Le.append_pdl1vj$(it.toString('UTF-16LE'));
return Unit;
};
}
function installDistribution$lambda$lambda$lambda_0(closure$stderrBuilder, closure$stderrBuilderUtf16Le) {
return function (it) {
closure$stderrBuilder.append_s8jyv4$(it);
closure$stderrBuilderUtf16Le.append_pdl1vj$(it.toString('UTF-16LE'));
return Unit;
};
}
function Coroutine$installDistribution(continuation_0) {
CoroutineImpl.call(this, continuation_0);
this.exceptionState_0 = 1;
this.local$stdoutBuilder = void 0;
this.local$stdoutBuilderUtf16Le = void 0;
this.local$stderrBuilder = void 0;
this.local$stderrBuilderUtf16Le = void 0;
}
Coroutine$installDistribution.$metadata$ = {
kind: Kotlin.Kind.CLASS,
Expand All @@ -165021,32 +165040,60 @@ module.exports = v4;
switch (this.state_0) {
case 0:
var tmp$, tmp$_0;
this.local$stdoutBuilder = StringBuilder_init();
this.local$stdoutBuilderUtf16Le = StringBuilder_init();
this.local$stderrBuilder = StringBuilder_init();
this.local$stderrBuilderUtf16Le = StringBuilder_init();
var $receiver = {};
$receiver.ignoreReturnCode = true;
$receiver.outStream = new NullWritable();
$receiver.errStream = new NullWritable();
var $receiver_0 = {};
$receiver_0.stdout = installDistribution$lambda$lambda$lambda(this.local$stdoutBuilder, this.local$stdoutBuilderUtf16Le);
$receiver_0.stderr = installDistribution$lambda$lambda$lambda_0(this.local$stderrBuilder, this.local$stderrBuilderUtf16Le);
$receiver.listeners = $receiver_0;
this.state_0 = 2;
this.result_0 = await_0(exec('wsl', ['--set-default-version', '1'], $receiver), this);
this.result_0 = await_0(exec('wsl', ['--help'], $receiver), this);
if (this.result_0 === COROUTINE_SUSPENDED)
return COROUTINE_SUSPENDED;
continue;
case 1:
throw this.exception_0;
case 2:
this.state_0 = 3;
this.local$stdoutBuilder.append_gw00v9$(this.local$stdoutBuilderUtf16Le);
this.local$stdoutBuilder.append_gw00v9$(this.local$stderrBuilder);
this.local$stdoutBuilder.append_gw00v9$(this.local$stderrBuilderUtf16Le);
if (contains(this.local$stdoutBuilder.toString(), '--set-default-version')) {
this.state_0 = 3;
this.result_0 = await_0(exec('wsl', ['--set-default-version', '1']), this);
if (this.result_0 === COROUTINE_SUSPENDED)
return COROUTINE_SUSPENDED;
continue;
} else {
this.state_0 = 4;
continue;
}

case 3:
this.state_0 = 4;
continue;
case 4:
this.state_0 = 5;
this.result_0 = invoke(distributionDirectory, this);
if (this.result_0 === COROUTINE_SUSPENDED)
return COROUTINE_SUSPENDED;
continue;
case 3:
case 5:
tmp$ = '"' + $module$path.join(this.result_0, get_distribution().installerFile) + '"';
tmp$_0 = ['install', '--root'];
var $receiver_0 = {};
$receiver_0.input = Buffer.from('');
this.state_0 = 4;
this.result_0 = await_0(exec(tmp$, tmp$_0, $receiver_0), this);
var $receiver_1 = {};
$receiver_1.input = Buffer.from('');
this.state_0 = 6;
this.result_0 = await_0(exec(tmp$, tmp$_0, $receiver_1), this);
if (this.result_0 === COROUTINE_SUSPENDED)
return COROUTINE_SUSPENDED;
continue;
case 4:
case 6:
return;
default:this.state_0 = 1;
throw new Error('State Machine Unreachable execution');
Expand Down
2 changes: 1 addition & 1 deletion build/distributions/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

group = net.kautler
version = 1.3.0
version = 1.3.1
description = A GitHub action to install and setup a Linux distribution for the Windows Subsystem for Linux (WSL)

org.gradle.caching = true
31 changes: 27 additions & 4 deletions src/main/kotlin/net/kautler/github/action/setup_wsl/SetupWsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,39 @@ suspend fun verifyWindowsEnvironment() {
}

suspend fun installDistribution() {
val stdoutBuilder = StringBuilder()
val stdoutBuilderUtf16Le = StringBuilder()
val stderrBuilder = StringBuilder()
val stderrBuilderUtf16Le = StringBuilder()
exec(
commandLine = "wsl",
args = arrayOf("--set-default-version", "1"),
args = arrayOf("--help"),
jsObject {
// ignore a failure in case WSLv2 is not available
// at all and thus `--set-default-version` is not
// a valid option for `wsl` at all
ignoreReturnCode = true
outStream = NullWritable()
errStream = NullWritable()
listeners = jsObject {
stdout = {
stdoutBuilder.append(it)
stdoutBuilderUtf16Le.append(it.toString("UTF-16LE"))
}
stderr = {
stderrBuilder.append(it)
stderrBuilderUtf16Le.append(it.toString("UTF-16LE"))
}
}
}
).await()
stdoutBuilder.append(stdoutBuilderUtf16Le)
stdoutBuilder.append(stderrBuilder)
stdoutBuilder.append(stderrBuilderUtf16Le)
if (stdoutBuilder.toString().contains("--set-default-version")) {
exec(
commandLine = "wsl",
args = arrayOf("--set-default-version", "1")
).await()
}

exec(
commandLine = """"${path.join(distributionDirectory(), distribution.installerFile)}"""",
args = arrayOf("install", "--root"),
Expand Down

0 comments on commit 4304e1b

Please sign in to comment.