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
1 changed files with 5 additions and 2 deletions

View File

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