Skip to content

Commit

Permalink
Updating "productName" parameter to default to "name" value in npm file.
Browse files Browse the repository at this point in the history
  • Loading branch information
domderen committed Apr 6, 2015
1 parent 84bebaf commit 85fa7ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atom-shell-installer",
"version": "0.2.1",
"version": "0.2.2",
"description": "Module to build Windows installers for Atom Shell apps, can be used with Gulp build system.",
"main": "dist/library-dist.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/InstallerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InstallerFactory {
this.iconUrl = iconUrl;
this.description = description || appMetadata.description;
this.version = version || appMetadata.version;
this.productName = appMetadata.productName;
this.productName = appMetadata.productName || this.name;
this.title = title || this.productName || this.name;
this.certificateFile = certificateFile;
this.certificatePassword = certificatePassword;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/InstallerFactory-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ describe('InstallerFactory', () => {
fs.renameSync.restore();
});

it('should resolve without renaming the file if no product name is provieded', (done) => {
it('should resolve with renaming the file using name if no product name is provieded', (done) => {
getPackageJsonStub.returns({author: 'some author', name: 'some name', version: '123', description: 'some desc', productName: undefined});
let installerFactory = new InstallerFactory({appDirectory: 'correctDir', remoteReleases: 'someUrl'});
let promise = installerFactory.updateSetupFile();
promise.then(() => {
expect(renameSyncStub.called).to.equal(false);
expect(renameSyncStub.calledWith(path.join(installerFactory.outputDirectory, 'Setup.exe'), path.join(installerFactory.outputDirectory, `${installerFactory.productName}Setup.exe`))).to.equal(true);
done();
});
});
Expand Down

0 comments on commit 85fa7ec

Please sign in to comment.