Skip to content
Permalink
Browse files

fix(packager): warn if the app version is not set

  • Loading branch information
malept committed Oct 23, 2017
1 parent e55ea98 commit 29070ca60c7bd40a4280f35249bab378d3991748
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/api/package.js
@@ -9,6 +9,7 @@ import { hostArch } from 'electron-packager/targets';

import getForgeConfig from '../util/forge-config';
import runHook from '../util/hook';
import { warn } from '../util/messages';
import realOra, { fakeOra } from '../util/ora';
import packagerCompileHook from '../util/compile-hook';
import readPackageJSON from '../util/read-package-json';
@@ -111,6 +112,11 @@ export default async (providedOptions = {}) => {
throw new Error('electron-compile does not support asar.unpack yet. Please use asar.unpackDir');
}

if (!packageJSON.version && !packageOpts.appVersion) {
// eslint-disable-next-line max-len
warn(interactive, "Please set 'version' or 'config.forge.electronPackagerConfig.appVersion' in your application's package.json so auto-updates work properly".yellow);
}

await runHook(forgeConfig, 'generateAssets');
await runHook(forgeConfig, 'prePackage');

3 comments on commit 29070ca

@danibishop

This comment has been minimized.

Copy link

danibishop replied Oct 23, 2017

I might be reading this the wrong way but the text on the warning (117) and the condition (115) say different things, isn´t it?

@malept

This comment has been minimized.

Copy link
Member Author

malept replied Oct 23, 2017

How are you interpreting it?

@danibishop

This comment has been minimized.

Copy link

danibishop replied Oct 23, 2017

I am wrong. I noticed it writing the comment. I was thinking in the equivalent:
if !(packageJSON.version || packageOpts.appVersion)

And for some reason I did not see it in your code. Sorry for the lost time.

Please sign in to comment.
You can’t perform that action at this time.