Skip to content

Commit

Permalink
Filter non-custom toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
Cengiz Gümüs authored and knopp committed Dec 22, 2023
1 parent c2eaabd commit d410182
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build_tool/lib/src/rustup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ class Rustup {
}

final res = runCommand("rustup", ['toolchain', 'list']);

// To list all non-custom toolchains, we need to filter out lines that
// don't start with "stable", "beta", or "nightly".
Pattern nonCustom = RegExp(r"^(stable|beta|nightly)");
final lines = res.stdout
.toString()
.split('\n')
.where((e) => e.isNotEmpty)
.where((e) => e.isNotEmpty && e.startsWith(nonCustom))
.map(extractToolchainName)
.toList(growable: true);

Expand Down

0 comments on commit d410182

Please sign in to comment.