-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: remove dead symlink from MAS build (#23831)
* build: remove dead symlink from MAS build * chore: new out cache * fix gn check errors Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
- Loading branch information
1 parent
673169a
commit 7a216a8
Showing
10 changed files
with
93 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const utils = require('./lib/utils'); | ||
|
||
if (process.platform !== 'darwin') { | ||
console.log('Not checking symlinks on non-darwin platform'); | ||
process.exit(0); | ||
} | ||
|
||
const appPath = path.resolve(__dirname, '..', '..', 'out', utils.getOutDir(), 'Electron.app'); | ||
const visited = new Set(); | ||
const traverse = (p) => { | ||
if (visited.has(p)) return; | ||
|
||
visited.add(p); | ||
if (!fs.statSync(p).isDirectory()) return; | ||
|
||
for (const child of fs.readdirSync(p)) { | ||
const childPath = path.resolve(p, child); | ||
let realPath; | ||
try { | ||
realPath = fs.realpathSync(childPath); | ||
} catch (err) { | ||
if (err.path) { | ||
console.error('Detected an invalid symlink'); | ||
console.error('Source:', childPath); | ||
let link = fs.readlinkSync(childPath); | ||
if (!link.startsWith('.')) { | ||
link = `../${link}`; | ||
} | ||
console.error('Target:', path.resolve(childPath, link)); | ||
process.exit(1); | ||
} else { | ||
throw err; | ||
} | ||
} | ||
traverse(realPath); | ||
} | ||
}; | ||
|
||
traverse(appPath); |
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