-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Respect unpack minimatch for symlinks within previously unpacked…
… directories (#341) * fix: Respecting unpack configuration when considering symlinks within previously unpacked directories. This directly fixes unpacking static `.framework` modules on Mac, as otherwise codesigning will fail due to symlink files/directories not being reflected in the app.asar.unpacked directory. Added unit test with Hello.framework, generated from tutorial https://jano.dev/apple/mach-o/2024/06/28/Hello-Static-Framework.html Fixes: electron-userland/electron-builder#8655 * adding unit test by programmatically create symlinks during test case (same approach as has been taken for filesystem UT already) * cleanup changes post-merging `main`
- Loading branch information
Showing
7 changed files
with
123 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const path = require('path'); | ||
const fs = require('../../lib/wrapped-fs').default; | ||
const rimraf = require('rimraf'); | ||
/** | ||
* Directory structure: | ||
* tmp | ||
* ├── private | ||
* │ └── var | ||
* │ ├── app | ||
* │ │ └── file.txt -> ../file.txt | ||
* │ └── file.txt | ||
* └── var -> private/var | ||
*/ | ||
module.exports = (testName) => { | ||
const tmpPath = path.join(__dirname, '../..', 'tmp', testName || 'app'); | ||
const privateVarPath = path.join(tmpPath, 'private', 'var'); | ||
const varPath = path.join(tmpPath, 'var'); | ||
|
||
rimraf.sync(tmpPath, fs); | ||
|
||
fs.mkdirSync(privateVarPath, { recursive: true }); | ||
fs.symlinkSync(path.relative(tmpPath, privateVarPath), varPath); | ||
|
||
const originFilePath = path.join(varPath, 'file.txt'); | ||
fs.writeFileSync(originFilePath, 'hello world'); | ||
const appPath = path.join(varPath, 'app'); | ||
fs.mkdirpSync(appPath); | ||
fs.symlinkSync('../file.txt', path.join(appPath, 'file.txt')); | ||
return { appPath, tmpPath, varPath }; | ||
}; |