2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-23 02:28:55 +00:00
This commit is contained in:
Ronan Jouchet 2021-02-25 18:19:30 -05:00
parent 9b52f210db
commit 5ea4638aea
2 changed files with 5 additions and 7 deletions

View File

@ -26,9 +26,7 @@ function iconIsIcns(iconPath: string): boolean {
* Will convert a `.png` icon to the appropriate arch format (if necessary), * Will convert a `.png` icon to the appropriate arch format (if necessary),
* and return adjusted options * and return adjusted options
*/ */
export async function convertIconIfNecessary( export function convertIconIfNecessary(options: AppOptions): void {
options: AppOptions,
): Promise<void> {
if (!options.packager.icon) { if (!options.packager.icon) {
log.debug('Option "icon" not set, skipping icon conversion.'); log.debug('Option "icon" not set, skipping icon conversion.');
return; return;
@ -43,7 +41,7 @@ export async function convertIconIfNecessary(
} }
try { try {
const iconPath = await convertToIco(options.packager.icon); const iconPath = convertToIco(options.packager.icon);
options.packager.icon = iconPath; options.packager.icon = iconPath;
return; return;
} catch (error) { } catch (error) {
@ -61,7 +59,7 @@ export async function convertIconIfNecessary(
} }
try { try {
const iconPath = await convertToPng(options.packager.icon); const iconPath = convertToPng(options.packager.icon);
options.packager.icon = iconPath; options.packager.icon = iconPath;
return; return;
} catch (error) { } catch (error) {
@ -85,7 +83,7 @@ export async function convertIconIfNecessary(
} }
try { try {
const iconPath = await convertToIcns(options.packager.icon); const iconPath = convertToIcns(options.packager.icon);
options.packager.icon = iconPath; options.packager.icon = iconPath;
return; return;
} catch (error) { } catch (error) {

View File

@ -112,7 +112,7 @@ export async function buildNativefierApp(
log.info('\nConverting icons...'); log.info('\nConverting icons...');
options.packager.dir = tmpPath; // const optionsWithTmpPath = { ...options, dir: tmpPath }; options.packager.dir = tmpPath; // const optionsWithTmpPath = { ...options, dir: tmpPath };
await convertIconIfNecessary(options); convertIconIfNecessary(options);
await copyIconsIfNecessary(options, tmpPath); await copyIconsIfNecessary(options, tmpPath);
log.info( log.info(