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
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 {}