From 712c80397d11319e22342d8e0f355fa567c8b430 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Wed, 10 Apr 2024 17:29:13 +0200 Subject: [PATCH] feat: Support packaging directories (#91) --- dist/build-crates-debian-main.js | 4 +--- dist/build-crates-standalone-main.js | 4 +--- dist/publish-crates-debian-main.js | 4 +--- dist/publish-crates-eclipse-main.js | 4 +--- dist/publish-crates-github-main.js | 4 +--- dist/publish-crates-homebrew-main.js | 4 +--- src/zip.ts | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index 0ecc72d..d5be75f 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -128454,9 +128454,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await promises_.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => external_path_.resolve(external_path_.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => external_path_.resolve(external_path_.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index 7963822..9737941 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -128453,9 +128453,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await promises_.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => external_path_.resolve(external_path_.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => external_path_.resolve(external_path_.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index fbaf2a3..bf981fa 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -128476,9 +128476,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await fs.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => path.resolve(path.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => path.resolve(path.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index 2faff23..2cc5b3a 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -128473,9 +128473,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await fs.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => path.resolve(path.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => path.resolve(path.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index ffb0fd9..48156b4 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -128454,9 +128454,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await fs.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => path.resolve(path.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => path.resolve(path.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index 07d4dc6..ccafd9b 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -128475,9 +128475,7 @@ async function dumpTOML(path, obj) { async function fromDirectory(output, dir, pattern) { const dirents = await fs.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => path.resolve(path.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => path.resolve(path.join(d.path, d.name))); fromFiles(output, ...files); } function fromFiles(output, ...files) { diff --git a/src/zip.ts b/src/zip.ts index 2323854..876bd68 100644 --- a/src/zip.ts +++ b/src/zip.ts @@ -6,9 +6,7 @@ import { sh } from "./command"; export async function fromDirectory(output: string, dir: string, pattern: RegExp) { const dirents = await fs.readdir(dir, { withFileTypes: true }); - const files = dirents - .filter(d => d.isFile() && pattern.test(d.name)) - .map(d => path.resolve(path.join(d.path, d.name))); + const files = dirents.filter(d => pattern.test(d.name)).map(d => path.resolve(path.join(d.path, d.name))); fromFiles(output, ...files); }