summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-11 07:59:01 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-11 07:59:01 +0200
commitbef7aa273eef984c0ea49ffa3df61989e47af18e (patch)
tree06966bc8577ed5debd54253fbb7cef20fbeaabf1 /check
parent826a78924bbed1bfd0e17a869a11ccf3d320bb9b (diff)
downloadsubplot-bef7aa273eef984c0ea49ffa3df61989e47af18e.tar.gz
fix: check for whether clippy is installed
Previously, "cargo --list" had "clippy" on its own line, with no description. Now it has a description, so we need to change how we look for clippy. Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck6
1 files changed, 5 insertions, 1 deletions
diff --git a/check b/check
index ac19c5f..cb5ffc1 100755
--- a/check
+++ b/check
@@ -107,7 +107,11 @@ class Runcmd:
def got_cargo(self, subcommand):
"""Is a cargo subcommand available?"""
p = self.runcmd(["cargo", "--list"], check=True, stdout=PIPE)
- lines = [line.strip() for line in p.stdout.decode("UTF-8").splitlines()]
+ lines = [
+ line.split()[0]
+ for line in p.stdout.decode("UTF-8").splitlines()
+ if line.strip()
+ ]
return subcommand in lines
def codegen(self, md, output, **kwargs):