3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-06-19 06:43:41 +00:00

explicitly close dir handles, add more logging, cleanups

This commit is contained in:
Arpad Borsos 2022-09-04 13:10:36 +02:00
parent 213334cd98
commit be4be3720d
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
5 changed files with 217 additions and 148 deletions

View file

@ -2,6 +2,8 @@ import path from "path";
import { getCmdOutput } from "./utils";
const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
export class Workspace {
constructor(public root: string, public target: string) {}
@ -17,7 +19,7 @@ export class Workspace {
if (pkg.manifest_path.startsWith(this.root)) {
continue;
}
const targets = pkg.targets.filter((t) => t.kind[0] === "lib").map((t) => t.name);
const targets = pkg.targets.filter((t) => t.kind.some((kind) => SAVE_TARGETS.has(kind))).map((t) => t.name);
packages.push({ name: pkg.name, version: pkg.version, targets, path: path.dirname(pkg.manifest_path) });
}
} catch {}