mirror of
https://github.com/The-Low-Code-Foundation/OpenNoodl.git
synced 2026-01-11 23:02:56 +01:00
Co-Authored-By: Eric Tuvesson <eric.tuvesson@gmail.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: Anders Larsson <64838990+anders-topp@users.noreply.github.com> Co-Authored-By: Johan <4934465+joolsus@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: victoratndl <99176179+victoratndl@users.noreply.github.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { unlinkSync } from 'fs-extra';
|
|
import path from 'path';
|
|
|
|
export function gitCleanUp(options: { gitDir: string; architecture: string }) {
|
|
if (process.platform === 'win32') {
|
|
console.log('Noodl Build: Cleaning unneeded Git components…');
|
|
const files = [
|
|
'Bitbucket.Authentication.dll',
|
|
'GitHub.Authentication.exe',
|
|
'Microsoft.Alm.Authentication.dll',
|
|
'Microsoft.Alm.Git.dll',
|
|
'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll',
|
|
'Microsoft.IdentityModel.Clients.ActiveDirectory.dll',
|
|
'Microsoft.Vsts.Authentication.dll',
|
|
'git-askpass.exe',
|
|
'git-credential-manager.exe',
|
|
'WebView2Loader.dll'
|
|
];
|
|
|
|
const mingwFolder = options.architecture === 'x64' ? 'mingw64' : 'mingw32';
|
|
const gitCoreDir = path.join(options.gitDir, mingwFolder, 'libexec', 'git-core');
|
|
|
|
for (const file of files) {
|
|
const filePath = path.join(gitCoreDir, file);
|
|
try {
|
|
unlinkSync(filePath);
|
|
} catch (err) {
|
|
// probably already cleaned up
|
|
}
|
|
}
|
|
}
|
|
}
|