From 7f3ebb1a69bca164087be134d28f6343fcf00a02 Mon Sep 17 00:00:00 2001 From: Ronan Jouchet Date: Sat, 29 Aug 2020 16:41:33 -0400 Subject: [PATCH] On successful build, better explain how to run the app and what to do with it (fix #1029) --- src/build/buildNativefierApp.ts | 13 +++++++++++++ src/cli.ts | 14 +++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/build/buildNativefierApp.ts b/src/build/buildNativefierApp.ts index fe0b4da..c864e79 100644 --- a/src/build/buildNativefierApp.ts +++ b/src/build/buildNativefierApp.ts @@ -126,5 +126,18 @@ export async function buildNativefierApp( const appPath = getAppPath(appPathArray); await copyIconsIfNecessary(options, appPath); + if (appPath) { + let osRunHelp = ''; + if (options.packager.platform === 'win32') { + osRunHelp = `the contained .exe file.`; + } else if (options.packager.platform === 'linux') { + osRunHelp = `the contained executable file (prefixing with ./ if necessary)\nMenu/desktop shortcuts are up to you, because Nativefier cannot know where you're going to move the app. Search for "linux .desktop file" for help, or see https://wiki.archlinux.org/index.php/Desktop_entries`; + } else if (options.packager.platform === 'darwin') { + osRunHelp = `the app bundle.`; + } + log.info( + `App built to ${appPath} , move it wherever it makes sense for you and run ${osRunHelp}`, + ); + } return appPath; } diff --git a/src/cli.ts b/src/cli.ts index bde2fcc..83f2f35 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -296,15 +296,7 @@ if (require.main === module) { } checkInternet(); const options = { ...positionalOptions, ...commander.opts() }; - buildNativefierApp(options) - .then((appPath) => { - if (!appPath) { - log.info(`App *not* built to ${appPath}`); - return; - } - log.info(`App built to ${appPath}`); - }) - .catch((error) => { - log.error('Error during build. Run with --verbose for details.', error); - }); + buildNativefierApp(options).catch((error) => { + log.error('Error during build. Run with --verbose for details.', error); + }); }