Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(maker-deb): return the correct outPath with a prerelease version #584

Merged
merged 2 commits into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"typescript": "^2.8.1"
},
"optionalDependencies": {
"electron-installer-debian": "^0.8.0",
"electron-installer-debian": "^1.0.0",
"electron-installer-dmg": "^2.0.0",
"electron-installer-flatpak": "^0.8.0",
"electron-installer-redhat": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/deb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"@electron-forge/shared-types": "6.0.0-beta.28"
},
"optionalDependencies": {
"electron-installer-debian": "^0.8.0"
"electron-installer-debian": "^1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/maker/deb/src/MakerDeb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class MakerDeb extends MakerBase<MakerDebConfig> {

const arch = debianArch(targetArch);
const name = (this.config.options || {}).name || packageJSON.name;
const versionedName = `${name}_${packageJSON.version}_${arch}`;
const versionedName = `${name}_${installer.transformVersion(packageJSON.version)}_${arch}`;
const outPath = path.resolve(makeDir, `${versionedName}.deb`);

await this.ensureFile(outPath);
Expand Down
10 changes: 10 additions & 0 deletions packages/maker/deb/test/MakerDeb_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('MakerDeb', () => {
beforeEach(() => {
ensureFileStub = stub().returns(Promise.resolve());
eidStub = stub().resolves();
(eidStub as any).transformVersion = (version: string) => version;
config = {};

MakerDeb = proxyquire.noPreserveCache().noCallThru().load('../src/MakerDeb', {
Expand Down Expand Up @@ -77,6 +78,15 @@ describe('MakerDeb', () => {
});
});

if (process.platform === 'linux') {
it('should return the proper pre-release version in the outPath', async () => {
(eidStub as any).transformVersion = require('electron-installer-debian').transformVersion;
packageJSON.version = '1.2.3-beta.4';
const outPath = await (maker.make as any)({ dir, makeDir, appName, targetArch, packageJSON });
expect(outPath).to.match(/1\.2\.3~beta\.4/);
});
}

describe('debianArch', () => {
it('should convert ia32 to i386', () => {
expect(debianArch('ia32')).to.equal('i386');
Expand Down
Loading