diff --git a/build_tool/lib/src/rustup.dart b/build_tool/lib/src/rustup.dart index 6cd331a..f284179 100644 --- a/build_tool/lib/src/rustup.dart +++ b/build_tool/lib/src/rustup.dart @@ -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);