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: Respect unpack minimatch for symlinks within previously unpacked directories #341

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update cli-spec.js
prettier
  • Loading branch information
mmaietta committed Nov 12, 2024
commit 803863c7aed76697663cf57d51b4558e1afed57a
8 changes: 6 additions & 2 deletions test/cli-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ describe('command line interface', function () {
);
assert.ok(

Choose a reason for hiding this comment

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

After git cloning on Windows, SymlinkedDir is not a symlink but rather a regular file. I suggest only testing this on macOS/Linux. No need to test on Windows since you're not handling symlink in window.

https://github.com/mmaietta/asar/blob/1676a0ea070967f818167164be5bf7d0e378fb41/src/disk.ts#L65-L68

fs
.realpathSync('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/SymlinkedDir/test.txt')
.endsWith(path.normalize('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/Test/test.txt')),
.realpathSync(
'tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/SymlinkedDir/test.txt',
)
.endsWith(
path.normalize('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/Test/test.txt'),
),
);
}
});
Expand Down