2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-11-04 20:38:03 +00:00

Make macOS "bundle identifier" mention Nativefier (fix #866) (#1259)

* Make macos bundle identifier mention nativefier

* Fix @types/debug here too

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
This commit is contained in:
Adam Weeden 2021-09-21 17:32:55 -04:00 committed by GitHub
parent 0d78978d9e
commit 46424f9795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,7 @@ function changeAppPackageJsonName(
appPath: string,
name: string,
url: string,
): void {
): string {
const packageJsonPath = path.join(appPath, '/package.json');
const packageJson = parseJson<PackageJSON>(
fs.readFileSync(packageJsonPath).toString(),
@ -171,6 +171,8 @@ function changeAppPackageJsonName(
log.debug(`Updating ${packageJsonPath} 'name' field to ${normalizedAppName}`);
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
return normalizedAppName;
}
/**
@ -212,9 +214,10 @@ export async function prepareElectronApp(
} catch (err: unknown) {
log.error('Error copying injection files.', err);
}
changeAppPackageJsonName(
const normalizedAppName = changeAppPackageJsonName(
dest,
options.packager.name as string,
options.packager.targetUrl,
);
options.packager.appBundleId = `com.electron.nativefier.${normalizedAppName}`;
}