Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add back globing #749

Merged
merged 20 commits into from
Jan 2, 2023
Merged

fix: add back globing #749

merged 20 commits into from
Jan 2, 2023

Conversation

ayushmanchhabra
Copy link
Collaborator

@ayushmanchhabra ayushmanchhabra commented Dec 30, 2022

Description

The nwbuild function parses the globing patterns in srcDir (for eg: srcDir: "./src/**/* .dist/**/*") and saves the list of file names in the files variable. The packager function uses the array to copy the relevant files to the outDir.

@ayushmanchhabra ayushmanchhabra marked this pull request as ready for review December 30, 2022 21:35
@ayushmanchhabra ayushmanchhabra enabled auto-merge (squash) December 30, 2022 21:36
@ayushmanchhabra ayushmanchhabra changed the title add globing fix: add back globing Dec 30, 2022
@ayushmanchhabra ayushmanchhabra enabled auto-merge (squash) December 30, 2022 23:57
@ayushmanchhabra ayushmanchhabra marked this pull request as draft January 2, 2023 02:17
auto-merge was automatically disabled January 2, 2023 02:17

Pull request was converted to draft

@ayushmanchhabra ayushmanchhabra marked this pull request as ready for review January 2, 2023 02:42
@ayushmanchhabra ayushmanchhabra enabled auto-merge (squash) January 2, 2023 02:42
if (basename(content) === "package.json" && nwPkg === undefined) {
nwPkg = JSON.parse(await readFile(content));
}
files.push(...contents);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this go outside the loop?
I'm getting

[ ERROR ] 2023-01-05T08:19:05.751Z Invalid array length

with it inside the loop when I have a large number of matched files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this seems to conflict:

You describe srcDir as: "Directory to hold NW app files unless or array of file glob patterns"

But then you do this:

let patterns = options.srcDir.split(" ");

If a user provides an array of glob patterns (like you document is allowed), it will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants