mirror of https://github.com/jiahaog/Nativefier
* Make macos bundle identifier mention nativefier * Fix @types/debug here too Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
This commit is contained in:
parent
0d78978d9e
commit
46424f9795
|
@ -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}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue