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: Folder's named "constructor" not being included in asar #8286

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-buttons-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix Folder's named "constructor" not being included in asar
8 changes: 4 additions & 4 deletions packages/app-builder-lib/src/asar/asar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class AsarFilesystem {
readonly headerSize: number = -1
) {
if (this.header.files == null) {
this.header.files = {}
this.header.files = Object.create(null) as { [key: string]: Node }
}
}

Expand All @@ -54,7 +54,7 @@ export class AsarFilesystem {
return null
}
child = new Node()
child.files = {}
child.files = Object.create(null) as { [key: string]: Node }
node.files![dir] = child
}
node = child
Expand All @@ -71,7 +71,7 @@ export class AsarFilesystem {
const name = path.basename(p)
const dirNode = this.searchNodeFromDirectory(path.dirname(p), true)!
if (dirNode.files == null) {
dirNode.files = {}
dirNode.files = Object.create(null) as { [key: string]: Node }
}

let result = dirNode.files[name]
Expand Down Expand Up @@ -105,7 +105,7 @@ export class AsarFilesystem {

let children = dirNode.files
if (children == null) {
children = {}
children = Object.create(null) as { [key: string]: Node }
dirNode.files = children
}
children[path.basename(file)] = node
Expand Down
Loading