mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
line endings will be the death of me
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3,6 +3,7 @@
|
||||
*.patch text eol=lf
|
||||
DEPS text eol=lf
|
||||
yarn.lock text eol=lf
|
||||
script/zip_manifests/*.manifest text eol=lf
|
||||
patches/**/.patches merge=union
|
||||
|
||||
# Source code and markdown files should always use LF as line ending.
|
||||
|
||||
@@ -18,28 +18,12 @@ export async function copyApp (targetDir: string): Promise<string> {
|
||||
const baseDir = path.dirname(process.execPath);
|
||||
const zipManifestPath = path.resolve(__dirname, '..', '..', 'script', 'zip_manifests', `dist_zip.${process.platform === 'win32' ? 'win' : 'linux'}.${process.arch}.manifest`);
|
||||
const filesToCopy = (fs.readFileSync(zipManifestPath, 'utf-8')).split('\n').filter(f => f !== 'LICENSE' && f !== 'LICENSES.chromium.html' && f !== 'version' && f.trim());
|
||||
const dirsToMake: string[] = [];
|
||||
for (const rel of filesToCopy) {
|
||||
const dir = path.dirname(path.resolve(targetDir, rel));
|
||||
if (!dirsToMake.includes(dir)) {
|
||||
dirsToMake.push(dir);
|
||||
}
|
||||
}
|
||||
for (const dir of dirsToMake) {
|
||||
await fs.promises.mkdir(dir, { recursive: true });
|
||||
}
|
||||
|
||||
console.log('copying to:', targetDir);
|
||||
for (const rel of filesToCopy) {
|
||||
console.log('base:', baseDir);
|
||||
console.log('rel:', rel);
|
||||
console.log('dir:', path.dirname(path.resolve(baseDir, rel)));
|
||||
console.log('exists p:', path.resolve(baseDir, rel));
|
||||
console.log('ls base:', fs.readdirSync(baseDir));
|
||||
console.log('ls dir:', fs.readdirSync(path.dirname(path.resolve(baseDir, rel))));
|
||||
console.log('exists rel:', fs.existsSync(path.resolve(baseDir, rel)));
|
||||
fs.copyFileSync(path.resolve(baseDir, rel), path.resolve(targetDir, rel));
|
||||
}
|
||||
await Promise.all(
|
||||
filesToCopy.map(async rel => {
|
||||
await fs.promises.mkdir(path.dirname(path.resolve(targetDir, rel)), { recursive: true });
|
||||
fs.copyFileSync(path.resolve(baseDir, rel), path.resolve(targetDir, rel));
|
||||
})
|
||||
);
|
||||
|
||||
return path.resolve(targetDir, path.basename(process.execPath));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user